Tuesday, September 3, 2013

DateTime is Broken

So as I walk down the street I ask another person, "hey, do you have the time?" They answer with something like 3:12 pm. That is useful information because of an assumption. The assumption is that we are fairly close by. Imagine I used my cell phone to randomly call a person somewhere in the world. The person answers 3:12 pm. That answer is fairly useless, because I don't know where I have called and don't know what time zone the answerer is in. We know that answering 3:12 without the pm could mean am or pm, but without time zone information the hour becomes meaningless.

Historically applications which run on one machine don't need to worry about time zone, but as more and more applications become global the notion of a DateTime object without a reference to time zone becomes ludicrous. Now one idea is to always convert dates to GMT, but this sucks because looking at a DateTime object does not tell you whether it had been converted or not. What you really need is a DateTime that holds TimeZone information otherwise your object holds data based on external context which is just wrong.

No comments:

Post a Comment