You are here: Re: arithmetics with timestamp? « PHP Programming Language « IT news, forums, messages
Re: arithmetics with timestamp?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация