For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > January 2007 > Re: difference between two date in seconds: problem with daylight









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: difference between two date in seconds: problem with daylight
Curtis

2007-01-30, 3:59 am

_mario.lat wrote:
> Hallo,
> I have to calculate difference in seconds between two timestamp (unixtime).
> the problem is when there is daylight saving time so in this case
> end-start shoultd be negative and wrong data.
> How can I do?
> there is a function that lead this problem?
> Thank you in advance,
> Mario.


Check out the manual: http://php.net/date - Look at the format
character, 'Z', which is your server's difference in time from GMT.
From there, you can handle DST or force the time to a specific offset.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com