What is the quickest way to internationalise a php webapp?
We need to be able to change all times & dates based on a timezone selected by a user…
[edit: this application is already in production. I’ve been given the task of making it usable on an international level asap.]
1) Store all your dates in UTC time. (Technically any single timezone would work, but it’s less complicated to stick with UTC.)
2) Call
date_default_timezone_set()with the user’s time zone.3) Use date() on those UTC times / UNIX timestamps.
The user will then see all dates and times with their timezone settings.
Make sure when creating dates that you use
gmdate()and set the MySQL timezone to be UTC as well.