Using time zones in a PHP web application

Viewed 4727

I've been looking around for a few hours now about what's the best way to use timezones in a PHP/MySQL web application, finding a definitive answer is hard. From what I've learnt so far it is best to store everyones stuff in the database in UTC (correct me if I am wrong).

When a user registers I will ask them for there timezone and then store that against there user. This would be in this format as a dropdown menu:

<option value="Europe/London">(GMT) Greenwich Mean Time : London</option>

The app I am building will allow users to set arrangements in the future with people (meetings), much like a calendar. Obviously over the course of a year different timezones have different daylight savings periods, any idea how I would cater for this?

Say a user from the UK sets a meeting for 3:00PM on January 24th 2013 and invites someone who lives in California to this meeting, how do I get it so that the American sees that meeting in his/her timezone and the UK user sees it in his/her timezone? (Note that both users are signed up and have set their timezone).

Does anyone have a clear explanation and maybe some examples for this? Or can point me to where I can find that?

Thanks

2 Answers
Related