View Single Post
Old 02-26-2008, 12:24 AM   #6 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

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
Attached Files
File Type: php timeZoneList.php (18.8 KB, 195 views)
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
The Following 4 Users Say Thank You to Alan @ CIT For This Useful Post:
Aaron (02-27-2008), DeMo (02-27-2008), ReSpawN (02-26-2008), SOCK (02-26-2008)