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

Posted by d on 09/28/42 11:37

"Super Mango" <liebermann@gmail.com> wrote in message
news:1137344888.413098.327320@o13g2000cwo.googlegroups.com...
> Hi everubody,
>
> 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?
> Say that I have this value in a variable -
> 1) how do I get the current system timestamp?
> 2) how do I subtract the first from the second?
>
> Thanks!

If you're going to be doing the vast majority of your time maths outside
MySQL, you might want to use integers instead of timestamps - you can just
save the unix timestamp in the database, which saves time converting between
MySQL and unix times. And, of course, you can still search/sort using the
unix timestamp...

 

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

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