Add a 1-hour expiration to the current time/date

前端 未结 5 580
没有蜡笔的小新
没有蜡笔的小新 2021-01-06 02:04
//expiration
$datetoday = date(\"F j, Y, G:i\");

$expquery = mysql_query(\"SELECT a_expire FROM regform_admin WHERE status = \'Pending for payment\'\");
$row = mysq         


        
5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-06 02:58

    Why don't you just check if the current hour is 23 ? Something like (I'm not sure about the PHP syntax of ternary operator though) :

    $onehour = date("G) > 22 ? 0 : date("G) + 1;
    

    Then you also want to change the current day, and check if you change year.

提交回复
热议问题