Jump to content

Working with date


apw

Recommended Posts

instead of using date("U") you can simply use time();

now, date has an optional second parameter, when you put in a timestamp it will use that instead of the current time, for example:

$thetime=time();
$timelimit=$thetime-3600;
$whatyouwant=date("h:i:s A",$timelimit);

 

And that should tell you the time an hour ago hehe.

 

see http://php.net/date for more info on the parameters and whatnot.

Link to comment
https://forums.phpfreaks.com/topic/190519-working-with-date/#findComment-1005039
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.