Reputation: 119
Warning: date(): Invalid date.timezone value 'Asia/Singapore', we selected the timezone 'UTC' for now: in path/file.php on line 14.
i'm having above error when running on the server, while in my code i did not put any timezone.
well the things is, if im running on my local wamp server, there's no error display at all.
below is my code
please advice. thanks.
Upvotes: 3
Views: 23856
Reputation: 386
Try this:
date.timezone = "Asia/Singapore"
Edit:
Let's locate the correct php.ini. Fire this within apache / nginx / whatever web server deamon your using (because the command line version may be different by the one used by it).
<?php
phpinfo();
?>
What's the .ini in the output? Still the same?
Edit2:
After the php.ini edit, just restart the webserver (apache or nginx.
Upvotes: 2
Reputation: 2263
Try to add following line before use of date function.
date_default_timezone_set('America/Los_Angeles');//change zone as per need
Upvotes: 1
Reputation: 152
if you want to ignore the warning, you can put this code at your first line
error_reporting(E_ALL ^ E_WARNING)
about timezone setting: not only PHP page can be set timezone but also php.ini can be set it.
Upvotes: 0