ปกติ เวลาปัจจบุันเราจะใช้
Code: Select all
time();
Moderators: mindphp, ผู้ดูแลกระดาน
Code: Select all
time();
Code: Select all
$timestamp = strtotime('today midnight');
Code: Select all
$timestamp = strtotime(date("Ymd"));
Code: Select all
30-07-2020 12:00:00
Code: Select all
30-07-2020 12:00:00 AM
Code: Select all
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")));
รู้เเล้ว
Code: Select all
$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 wrote: ↑22/09/2020 8:17 pmรู้เเล้วCode: Select all
$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);
Users browsing this forum: No registered users and 10 guests