[wp-hackers] Storing absolute time stamps

Omry Yadan omry at yadan.net
Mon Jun 25 17:38:21 GMT 2007

The correct solution to the problem you described is to work with time
zones and not time offsets, and consider the timezone DST.

for time zones that have DST but does not have constant DST dates the
user should be able to specify those days.

James Davis wrote:

> Omry Yadan wrote:
>> if the time of the posts is in UTC, its always correct.
>> keeping the time as UTC will also allow showing different time to
>> different users, based on their time zone. (assuming some way for the
>> users to specify their time zones).
> The time in UTC will be correct but people don't display the date of
> their posts in UTC. Here's an example of what might go wrong with your
> proposal.
> - It's 17:00 UTC, local time is an hour in advance of that, 18:00. The
> offset is +1.
> - They make a post. The blog claims the post was made at 18:00.
> - local time gets set back an hour that night, the admin changes the
> offset to 0.
> - The post is displayed, WordPress calculates the time it was made by
> adding the offset to the UTC time and displays 17:00 localtime. This is
> incorrect, the post was made at 18:00 localtime!
> HTH,
> James

More information about the wp-hackers mailing list