Jump to content

Timestamp question


almightyegg

Recommended Posts

I was wondering if somebody could point me in the right direction (either by starting the code/telling me the functions I need to use/sending me to a tutorial) for taking a timestamp and working out how many years, months, weeks, days, hours, minutes, seconds ago it was.

 

Thanks in advance :D

Link to comment
https://forums.phpfreaks.com/topic/99295-timestamp-question/
Share on other sites

$timespan = $current - $savedtime;

$timetotal = date("H:i:s m/d/Y");

echo $timetotal.'since last savedtime;

 

 

try it!

 

This is incorrect.

 

$current = insertYourDateFunction
$savedtime = insertTimeStamp
$timespan = $current - $savedtime;
echo $timespan . 'since last savedtime';

Link to comment
https://forums.phpfreaks.com/topic/99295-timestamp-question/#findComment-508069
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.