php - One Hour Earlier Than Given Datetime

前端 未结 5 556
不思量自难忘°
不思量自难忘° 2020-12-20 14:16

I\'m having a problem here..

Supposed I have this kind of datetime.


$date = strtotime($date);

I need this to be converted into t

5条回答
  •  情书的邮戳
    2020-12-20 14:54

    Try this query

    $query= "insert into yourTable(otherValues, date) 
    values (otherFields, DATE_ADD(NOW(),INTERVAL -1 hour))
    

    Use DATE_ADD to insert a date value which is 1 hour less than current time.

提交回复
热议问题