คำตอบที่ได้รับเลือกจากเจ้าของกระทู้
ความคิดเห็นที่ 2
ใส่ date_default_timezone_set("Asia/Bangkok"); ไว้บนสุดของไฟล์ php
▼ กำลังโหลดข้อมูล... ▼
แสดงความคิดเห็น
คุณสามารถแสดงความคิดเห็นกับกระทู้นี้ได้ด้วยการเข้าสู่ระบบ
มีปัญหา time zone กับการเขียน php
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. in D:\AppServ\www\PHP\library\cart-functions.php on line 229
ข้างล่างนี้คือโค๊ดบรรทัดที่แจ้ง error
function deleteAbandonedCart()
{
$yesterday = date('Y-m-d H:i:s', mktime(0,0,0, date('m'), date('d') - 1, date('Y'))); <!--บรรทัดนี้คือบรรทัดที่ 229-->
$sql = "DELETE FROM tbl_cart
WHERE ct_date < '$yesterday'";
dbQuery($sql);
}
ขอบคุณครับ