Posted by Toby Inkster on 09/28/41 11:37
Super Mango wrote:
> I have a timestamp field in a mysql DB and I want to know how much time
> has past since that timestamp.
<?php
// Assume timestamp from database is in $ts.
$then = strtotime($ts);
$now = time();
$diff = $now - $then;
// $diff is the difference in seconds.
?>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|