Jump to content

[SOLVED] Timestamp


phpcodec

Recommended Posts

<?php

$stamp1 = 1218489981;
$stamp2 = 1218493687;

$diff = abs( $stamp1 - $stamp2 );

$hours = 0;
$mins = 0;
$sec = 0;

$hours = floor( $diff/3600 );
$mins = floor( ($diff-$hours*3600)/60 );
$sec = $diff-$hours*3600-$mins*60;

echo "$hours:$mins:$sec";

?>

Link to comment
https://forums.phpfreaks.com/topic/119206-solved-timestamp/#findComment-613994
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.