3 ms·
It seems wrong, or VB-ish, to assume the local system settings for things such as parsing. Shouldn't the default be to use UTC, and then force developers to opt
by MichaelGG 13y ago
It seems wrong, or VB-ish, to assume the local system settings for things such as parsing. Shouldn't the default be to use UTC, and then force developers to opt-in to "whatever the user currently has"? Or at force parseUtc or parseLocal? I understand that there's an argument for doing what the programmer probably has in mind, but in too many cases, the programmer hasn't even thought of that.
The fact you could run this, take a flight somewhere, run it again and get totally different results seems unsettling. (Same thing applies to numeric parsing/display functions.)
I ran into one customer having problems authenticating to our service; turns out his clocks were on local time, not UTC. He seemed upset about that, until I pointed out that his billing records will get an extra hour, or go negative, during DST transitions. Changed his tune pretty quickly.
Another customer handled it a different way: "Oh, the platform we use crashes when a time transition occurs, so we never generate records spanning such times."