There seems to be one constant in writing software. This one constant is quite often the bane of my software projects. That bane is a date. Not date as in woman. Not date as in fruit seed. Date as in expressing the current date and time. Handling dates will consume a significant percentage of development time when dates are somehow involved.
Consider:
Different countries have different languages and thus different names for months.
Different countries have different standard date notations, e.g. 9/17/07 (US) 07-09-17 (most of Europe).
Computers natively express dates as the number of seconds since January 1, 1970.
Some time zones are designated by acronym (EST, PST, etc.), some are designated by major cities (Asia/Bangkok), some have multiple names (UTC, GMT), and some have no name at all (UTC+7).
Some times zones are offset by 30 minutes.
Some time zones, but not all, observe daylight savings.
The first (and last) day of daylight savings observance changes from year to year at the whims of governments.
Leap years and leap seconds.
The International Date Line.
For any programmers out there who might be looking for advice, my recommendation is this. Keep just two pieces of information.
Keep the date in its native format, the number of seconds since January 1, 1970, in the UTC time zone.
Keep the name of the time zone you care about.
Those two pieces of information are the bare minimum you need to make any date conversion you might need. Bare minimum in this case is good. More data will only confuse the issue.
You might think you want to record, for example, the day of the week (Monday). But then think what all goes in to converting Monday in PST to the same date in Thailand where it's already Tuesday. Then consider that it might be either PST or PDT in California. You have to check the date in California to see if it was PST or PDT; remember that it varies from year to year depending on the whims of governments.
Pulled eFingers:
Ngan 2007-09-17 12:14:10 US/Pacific
Wow...I never thought about how much work goes into all the programs/software I have on my computer.