[wp-hackers] Storing absolute time stamps

James Davis james at freecharity.org.uk
Mon Jun 25 14:13:15 GMT 2007


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

-- 
http://www.freecharity.org.uk/ - Free IT services for charities
http://www.freecharity.org.uk/wiki/ - The VCSWiki


More information about the wp-hackers mailing list