Jump to content

time comparison


EchoFool

Recommended Posts

I need help working out how to compare the difference in seconds between two time stamps... i keeps returning 0 as a result.. this is what i have at the moment:

 

<?php
$User1HitTime = 2008-10-17 17:34:42;
$Date = 2008-10-17 18:39:43;

			If($Att == $_SESSION['Current_User']){
				$Date = $Date - $User1HitTime;
Echo $Date;
					If($Date < 2){
					$Second = 1;
					}
			}
?>

 

The Echo of $Date comes out as 0... when it should surely not be?

 

What did i do wrong?

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