Reply to Re: arithmetics with timestamp?

Your name:

Reply:


Posted by Gordon Burditt on 01/15/06 22:37

>I have a timestamp field in a mysql DB and I want to know how much time
>has past since that timestamp.
>
>is it possible?

Yes. Use MySQL to do it.

>Say that I have this value in a variable -
>1) how do I get the current system timestamp?

now()

>2) how do I subtract the first from the second?

timestampdiff(). (requires MySQL 5.0 or greater).
timediff(), but it returns the value in hours, minutes, and seconds.
datediff(), but only the date parts are used.

Gordon L. Burditt

[Back to original 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

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