Jump to content

calculating time to display hours and minutes


alohatofu

Recommended Posts

I have 2 dates one is now and the other date I have output as 2007-04-18 02:05:22

 

2007-04-18 02:05:22 is the first date = $creationDate

and $timestamp = time();

 

when i use $result = $timestamp - $creationDate;

it out put time in 1176956379

 

How can I format them in hours and minutes?

 

Thank you

Hi mates

You can do the following , i am giving you details with printing some text below:

 

<?
echo "TimeStamp of 2007-04-18 02:05:22 is : " . strtotime("2007-04-18 02:05:22");
echo "<br>";
echo "Current Time is : "  . time();
echo "<br>";
$timeSt = (time() - strtotime("2007-04-18 02:05:22"));
echo "<pre>";
echo "After Calculation of those Result in time is  :" . date("H:i:s" , $timeSt);
?>

 

Thanks

Shaymol

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.