With a YYYY-MM-DD HH:MM:SS date I always store the UTC time. When I pull to display I translate timezones with built-in PHP functions and classes.
I believe that is one correct way to do it and it makes sense to me.
May I handle YYYY-MM-DD the same way?
1
That would depend on how you interpreted the date.
If you use the date as though it were YYYY-MM-DD 00:00:00 (or any specific time) then you would probably want to take account of time zones.
If you use the date as just on indication of the day then you probably don’t.
This is vague as without the context of what you are doing with the dates, it is just guesswork.
A date alone is pretty meaningless without the location/timezone.
http://en.wikipedia.org/wiki/Coordinated_Universal_Time
http://en.wikipedia.org/wiki/Time_zone
http://en.wikipedia.org/wiki/List_of_UTC_time_offsets
UTC offsets range from -12:00 to +14:00. That’s a span of 26 hours, plus the 24 hours the day will last. This means that yesterday’s doomsday (yesterday relative to my local timezone) lasted for a total of 50 hours. I.e. for 50 hours, somewhere on the world it is the 21st Dec. 2012. And then there’s the daylight saving time.
Did you see any end-of-the-world-agenda (2:00pm – The Mayans will return to earth with an alien spaceship) or end-of-the-world-24h-countdown that included the timezone?
3