01-30-2008, 05:17 PM
|
#2 (permalink)
|
|
The Frequenter
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
|
date_default_timezone_set() allows you to change the timezone for your script. For example:
PHP Code:
date_default_timezone_set('Europe/London');
echo date('H:i:s', time());
// shows: 17:13:40
date_default_timezone_set('Australia/Tasmania');
echo date('H:i:s', time());
// shows: 04:13:40
As you can see, date() has given us different times depending on what timezone we have set.
You can provide this functionality by storing the users timezone choice (full list: PHP: List of Supported Timezones - Manual) then using date_default_timezone_set() before you run any date/time functions.
Also, PHP5 expects you to set a default timezone using date_default_timezone_set() before you use any date functions
Alan
|
|
|