Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends

i want to get the time difference with the help of my code working fine on local server but it gives wrong result when i use it to server please tell me what is the problem

PHP
<?php

$first=$status['in_time']."".$status['am_time'];
$second=$status['out_time']."".$status['pm_time'];
$d1=  strtotime($first);
$d2=  strtotime($second);
$diff=$d2-$d1;
//echo $diff;
echo date("H:i",$diff);
?>
Posted
Comments
Zoltán Zörgő 19-Mar-13 3:19am    
do a var_dump($status) and see the differences between your machine and the server. Please remember, that strtotime is expecting English formats, as described on the manual page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900