hi All:
I'm facing problem calcualting differnec between Date and Sessiontime.I have 2 variables.
1.LogoutDate //Format is:"2003-04-19 11:53:11 AM"
2.Sessiontime //i.e Time in Seconds
Now I have to Calculate the user login date and time having both these values..I'm new to PHP I have tried the following code but it gives strang resultes.
/////----Code starts here---- //////
<?php
//session time is 155 seconds...
$sesstime = mktime(0,0,155);
$logoutdate = strtotime("2003-04-19 11:53:11 AM");
$Firstdate =$sesstime;
$Lastdate = $logoutdate;
echo "<br>";
//difference Calculation
$diff = $Lastdate-$Firstdate;
echo "<br>";
echo "Difference is:" , date("y-m-d h:i:s A",$diff);
?>
/////----Code Ends here---- //////
AND RESULT IS:
"Difference is:69-12-28 06:50:36 AM"
I was suppose to Recieve "("2003-04-19 11:50:36 AM")"Only Minutes and Seconds are subtracted but the whole date format is strang.
imediate help will highly be appriciated.
Thanks