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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: