Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-02-20 08:57:28

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Warning: date_default_timezone_get()

For the record, I hit a problem after upgrading my PHP installation. The following message was displayed in TXP admin and on the website:

Warning: date_default_timezone_get() [function.date-default-timezone-get]: 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 'Australia/Melbourne' for 'EST/11.0/DST' instead in ......../textpattern/lib/txplib_misc.php on line 2525

In my case I was upgrading from PHP 5.3.1 to 5.3.5. Problem seen in TXP 4.2.0 & 4.3.0

The fix is to set the timezone explicitly in the php.ini file:

date.timezone = Australia/Melbourne

The line was commented out & I’m not sure if PHP has suddenly become picky or my php.ini file had been overwritten during the upgrade.

Offline

#2 2011-05-03 13:42:40

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

Re: Warning: date_default_timezone_get()

I have the same warning, but i can’t edit my php.ini.

There is another way to solve the problem?

Last edited by MarcoK (2011-05-03 13:42:57)

Offline

#3 2011-05-03 15:25:12

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

Re: Warning: date_default_timezone_get()

I have txp 4.4.

I have solved the problem, by editing config.php in textpattern/ dir adding

date_default_timezone_set('Europe/Rome'); //Rome in my case

Offline

#4 2011-11-23 20:44:35

brunodario
Member
From: Belo Horizonte, Brasil
Registered: 2007-09-19
Posts: 75

Re: Warning: date_default_timezone_get()

Just for the records either, i had the same bug with txp 4.4.1 after the hosting company upgraded php to 5.3.5. MarcoK solution did it… (I can´t access php.ini on this server).
Thx a lot…

Offline

#5 2012-07-18 17:46:24

defender2010
New Member
Registered: 2012-07-18
Posts: 1

Re: Warning: date_default_timezone_get()

Marcok, where is that config.php file you mention where to add the configuration for the time zone settings?
thanks

Offline

#6 2012-07-18 21:03:02

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Warning: date_default_timezone_get()

config.php is in /textpattern/.

Offline

Board footer

Powered by FluxBB