02-26-2008, 12:24 AM
|
#6 (permalink)
|
|
The Frequenter
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
|
Infact it is a very common error  PHP5 requires you to set the default timezone before using any date functions.
If you are unable to do this in your php.ini file, then you can use date_default_timezone_set() as Sock mentioned.
Example:
PHP Code:
date_default_timezone_set('Europe/London');
// ... your date() functions here ...
Note about the default timezone requirement: PHP: date - Manual (see the Errors/Exception part)
List of supported timezones: PHP: List of Supported Timezones - Manual
And finally, attached is a PHP file with all the above timezones in an array. I use it to generate a <select> dropdown list to let the users set their own timezone.
Alan
|
|
|