ปกติ เวลาปัจจบุันเราจะใช้
โค้ด: เลือกทั้งหมด
time();
Moderator: mindphp, ผู้ดูแลกระดาน
โค้ด: เลือกทั้งหมด
time();
โค้ด: เลือกทั้งหมด
$timestamp = strtotime('today midnight');
โค้ด: เลือกทั้งหมด
$timestamp = strtotime(date("Ymd"));
โค้ด: เลือกทั้งหมด
30-07-2020 12:00:00
โค้ด: เลือกทั้งหมด
30-07-2020 12:00:00 AM
โค้ด: เลือกทั้งหมด
echo 'today midnight =>';
echo date('d-m-Y h:i:s A', strtotime('today midnight'));
echo '<hr>';
echo 'Ymd =>';
echo date('d-m-Y h:i:s A', strtotime(date("Ymd")));
รู้เเล้ว
โค้ด: เลือกทั้งหมด
$date_notify_expire = strtotime(" 7 day");
$date_notify_expire = strtotime(date("d-m-Y",$date_notify_expire)."00:00:00");
echo date("d-m-Y H:i:s",$date_notify_expire);
วิธีนี้จะมีปัญหาหับ time zonethatsawan เขียน: ↑22/09/2020 8:17 pmรู้เเล้วโค้ด: เลือกทั้งหมด
$date_notify_expire = strtotime(" 7 day"); $date_notify_expire = strtotime(date("d-m-Y",$date_notify_expire)."00:00:00"); echo date("d-m-Y H:i:s",$date_notify_expire);
สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 114