|
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
Navigation:
[Reply to this message]
|