php : Mengatasi error Warning: strtotime(): It is not safe to rely on the system’s timezone settings.

Oleh : Abah Razi

بسم الله الرحمن الرحيم

Saat menggunakan strtotime kita mendapatkan error seperti berikut :

[code language=”php”]

Warning: strtotime(): 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 ‘America/New_York’ for ‘EDT/-4.0/DST’ instead in /home/rezaervani/public_html/tokobuku.rumahilmu.co.id/public/cintabuku/kustomer/historitransaksi.php on line 85 Warning: date(): 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 ‘America/New_York’ for ‘EDT/-4.0/DST’ instead in /home/rezaervani/public_html/tokobuku.rumahilmu.co.id/public/cintabuku/kustomer/historitransaksi.php on line 85 14 October 2014

[/code]

Untuk mengatasinya kita perlu mensetting php.ini di bagian ini

[code language=”bash”]

; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =

[/code]

Isi bagian date.timezone itu dengan area waktu kita, misalnya Asia/Jakarta

menjadi :

[code language=”bash”]

; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Jakarta

[/code]

About Reza Ervani 426 Articles
Adalah pendiri programming.rezaervani.com -

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.