Reply to Re: Calculating the difference

Your name:

Reply:


Posted by Erwin Moller on 10/01/07 14:05

Julius wrote:
> Hej dudes,
>
> I need to calc the difference between two timestamps / dates ...
>
> For example what i need to calculate:
>
> Date 1: 2007.11.06 - 20:13:04
> Date 2: 2007.11.07 - 21:13:04
>
> Difference: 1 day, 1hour
>
> Very simple in php ..

Very simple?

>
> but how do i calculate the difference between the following values:
>
> Date 1: 2007.11.06 - 20:13:04
> Date 2: 2007.11.08 - 03:13:04
>
> Does someone have a quick solution for this ?
> Thanks ahead ...
>

Why is the first simple and the second hard?

Anyway: go to www.php.net and look up: strtotime

Then use the difference in time to calculate the elapsed <whatever unit
suits you>.

Beware of timezone offset stuff. If it is not in the original date,
don't worry.

Regards,
Erwin Moller

[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

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