Jump to content

time in php


liomon41

Recommended Posts

$timeMinus1Hour = gmdate("Y-m-d H:i:s", strtotime("-1 hour", strtotime($time)));

 

Where $time is the date/time timestamp from the database. Bare in mind time-zones; I did that using Greenwich Mean Time.

 

A simple comparison of the two timestamps will give you your answer.

Link to comment
https://forums.phpfreaks.com/topic/263934-time-in-php/#findComment-1352600
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.