Jump to content

Time Function Question


hanlonj

Recommended Posts

PHP does not have a datediff function like ASP, but it is relatively easy.

Take date 1 and use the date fucntion to return you seconds.

$loggedIn = date("U", mktime(h,m,s,m,d,y));

and right now is

$now = date("U");

take $now - $loggedIn and you now have the SECONDS that have passed between the two dates.

I day is 86400 seconds, 1 hour is 3600 seconds, one minute 60 seconds.
Link to comment
https://forums.phpfreaks.com/topic/20784-time-function-question/#findComment-92024
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.