Hi,
How does one gee the time in Php for 2 different time snap shots and then see how many minutes they are apart?
I tries this sample test, and it does not work:
if (!isset($_SESSION['t1'])) {
$_SESSION['t1'] = time();
}
echo '<p>Time 1 is: ' . $_SESSION['t1'];
//Note: this was added a few minutes after t1
if (!isset($_SESSION['t2'])) {
$_SESSION['t2'] = time();
}
echo '<p>Time 2 is: ' . $_SESSION['t2'];
echo '<p>Time difference in Sec is: ' . ($_SESSION['t2'] - $_SESSION['t1']);
echo '<p>Time difference in Min is: ' . (($_SESSION['t2'] - $_SESSION['t1']) / 60);
The above produces negative numbers which obviously are not right.
ThaNX,