Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

default timezone error in php

I got the following error/warning while tring to install Kohana/SilverStripe.
What does it mean and What do I do for it?

Warning:
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 'Asia/Calcutta' for '5.5/no DST' instead in C:\Server\apache\htdocs\kohana\system\core\Kohana.php on line 136

Thanks in Advance!

like image 588
OrangeRind Avatar asked Sep 01 '26 05:09

OrangeRind


1 Answers

This is not an error, but a warning, so it does not block your app from working.

Explicitly set the right timezone using date_default_timezone_set() in C:\Server\apache\htdocs\kohana\system\core\Kohana.php on line 136

You have to choose among valid timezones


Edit

As the warning message itself states you actually have a more clean choice then editing a third party software file. I.e. configuring PHP as it should be.

  • edit your php.ini and adjust the value of date.timezone = America/New_York

or

  • use a php_value directive in your web server config to set it in your vhost configuration or .htaccess: php_value date.timezone America/New_York
like image 88
drAlberT Avatar answered Sep 03 '26 19:09

drAlberT