PHP : ปัญหาเรื่อง ฟังก์ชั่น Date TimeZone
วันนี้หลังจากที่ย้ายบ้านหลังใหม่โดยใช้ Code เดิม เจอปัญหาที่ขึ้นว่า
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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.
ปัญหาเกี่ยวกับฟังก์ชั่น DateTime ใน PHP ตัวนี้สามารถแก้ไขได้โดย การเพิ่ม Code เข้าไปครับ
date_default_timezone_set("Asia/Bangkok");
ให้นำไปใส่ไว้บน HEAD หรือ ประกาศก่อนการใช้ Funtion Date นะครับ ปัญหาด้านบนดังกล่าวก็จะหมดไปครับ
เทคนิคเล็กๆ น้อยๆ แต่แก้ปัญหากวนใจได้เยอะเลยทีเดียวครับ
มาเป็นเพื่อนกันครับ บนช่องทาง Social ด้านล่างนี้ครับ
--------------------------► LINE@ : @siamfocus.com
► Facebook : fanpage.siamfocus
► Twitter (X) : siamfocus
► Linkedin : taam-siamfocus
► Instagram : iamtaam
► Youtube : SiAMFOCUS
► Tiktok : @taamsiamfocus
--------------------------