Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Which timezone to use for an international calendar applicaton

2:40 am on Apr 16, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 20, 2004
posts: 615
votes: 0

Hello All -

I've been having some problems with the correct javascript date display from a php calendar application I've written.

This application simply takes the timestamp for the current date (at 12:01pm) and generates a calendar for the next 12 months. When a user clicks on one of the dates, the timestamp for the date clicked is retrieved and other stuff happens.

The good news is that the javascript display issue has been solved through a work around. However, further testing regarding which timezone to implement for this application has me baffled. If you're creating an application that is dependent upon an accurate unix timestamp for any given date - which could be displayed from any timezone in the world - what is the correct timezone setting to use?

For example, in my application I'm using my local time zone setting - ini_set('date.timezone','Asia/Manila'). When I run a test for April 15, 2012 12:01pm I get a timestamp of 1334462460. If I then change the time zone setting to ini_set('date.timezone','America/New_York'), I get a timestamp of 1334505660.

Oh no!

I *thought* that a timestamp for a particular date would be the same no matter where in the world a user was, but apparently this is really determined by the timezone ini setting. Correct?

So, after all of that, my real question is: what is the "safest" timezone to implement for calendar application which could be potentially accessed from any timezone? ini_set('date.timezone','Europe/London')... which would be UTC 0?

If further clarification is needed, please do ask.

Thanks to all in advance!
9:38 am on Apr 16, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
votes: 0

Normalise everything to UTC.

UTC is 4 hours ahead of New York clocks in US Summer when DST is in effect. UTC is 5 hours ahead of New York clocks in US Winter when the US is back on standard time.

The UK uses UTC for clock time (known as GMT) only in their Winter. In the UK summer, UK clocks use UTC+0100 (known as BST - British Summer time, and is the same as GMT+1) a DST time zone.
7:53 am on Apr 17, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 20, 2004
posts: 615
votes: 0

Hello g1smd -

Thanks very much for the input!