ASD
ASD

Reputation: 4957

php codeigniter - strtotime error

Getting strtotime error in php-codeigniter and the problem arises only in windows 7 not in windows xp. Error : [2048] strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 'UTC' for '5.5/no DST' instead

Any help.

Upvotes: 0

Views: 1594

Answers (4)

Chaitanya Desai
Chaitanya Desai

Reputation: 323

Just use this:

date_default_timezone_set('UTC');

UTC stands for universal time zone, or you can set according to the country you want to set.

Check this page.

Upvotes: 0

Prasenjit
Prasenjit

Reputation: 11

Without overriding php.ini file you can put the following code in your page

$default_timezone = date_default_timezone_get(); date_default_timezone_set($default_timezone);

Upvotes: 0

stormdrain
stormdrain

Reputation: 7895

It's safe to ignore this error if the time isn't critical. Change error_reporting from E_STRICT to hide the error.

Upvotes: 0

Matthew
Matthew

Reputation: 15652

In your php.ini file, put this (or your own timezone):

date.timezone = "US/Central"

Upvotes: 1

Related Questions