wiki:phptimezone

Version 1 (modified by Serge Okon, 14 years ago) ( diff )

--

Editing php.ini to set the timezone

When I re-installed php, I got this error when rendering Ipeer.

( ! ) Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /srv/http/compatibility/cake/basics.php on line 796
Call Stack
#	Time	Memory	Function	Location
1	0.0004	338248	{main}( )	../index.php:0
2	0.0644	3930616	Dispatcher->dispatch( )	../index.php:84
3	0.0763	4433524	Controller->constructClasses( )	../dispatcher.php:217
4	0.0764	4442404	Model->__construct( )	../controller.php:298
5	0.0874	5000600	Model->setSource( )	../model_php5.php:326
6	0.0875	5000716	DboMysql->listSources( )	../model_php5.php:532
7	0.0875	5000716	DboSource->listSources( )	../dbo_mysql.php:149
8	0.0876	5001068	cache( )	../dbo_source.php:141
9	0.0876	5001188	strtotime ( )	../basics.php:796

So I modified this in /etc/php/php.ini to fix it:

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Vancouver"

(Use your own timezone, obviously. :-)

Note: See TracWiki for help on using the wiki.