PHP : Warning: date() [function.date] แก้ด้วย ฟังก์ชัน date_default_timezone_set()

Warning: date() [function.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 'Asia/Krasnoyarsk' for '7.0/no DST' instead in ...

วิธีแก้ไข
<?php
    date_default_timezone_set('Asia/Bangkok');
?>

ฟังก์ชัน date_default_timezone_set()
การใช้ฟังก์ชัน date_default_timezone_set() เพื่อตั้งค่า timezone

ตัวอย่างเช่น timezone
America/Los_Angeles
America/New_York
America/Sao_Paulo
Asia/Tokyo

Asia/Bangkok

ไม่มีความคิดเห็น:

แสดงความคิดเห็น