Tag Archives: Apache HTTP Server

PHP Warning: ‘It is not safe to rely on the system’s timezone settings’ when using date() function

If you get this error on your PHP baseb web application, this means you haven’t set your timezone in your PHP environment. So the date() function will use time information from your OS timezone.

To prevent this error, just open your php.ini file, change the parameter:

; date.timezone

to (depends on your location, for example Jakarta):

date.timezone = 'Asia/Jakarta'

Save, and restart your web server daemon.