Jump to content

subtracting time...


Perad

Recommended Posts

$lastlogin = strtotime($row['last_login']);

$now = strtotime(now);

$difference = date("u", $now) - date("u", $lastlogin);

 

I want to know if there is an hour difference between now and when the user last logged in. How do I do this as I am completely failing when I try to subtract the two with date functions.

Link to comment
https://forums.phpfreaks.com/topic/72299-subtracting-time/
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.