homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Which timezone to use for an international calendar applicaton

10+ Year Member

Msg#: 4441209 posted 2:40 am on Apr 16, 2012 (gmt 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!



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

Msg#: 4441209 posted 9:38 am on Apr 16, 2012 (gmt 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.


10+ Year Member

Msg#: 4441209 posted 7:53 am on Apr 17, 2012 (gmt 0)

Hello g1smd -

Thanks very much for the input!


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved