By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,716 Members | 1,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,716 IT Pros & Developers. It's quick & easy.

difference between two date in seconds: problem with daylight saving time

P: n/a
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.
Jan 30 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
_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.
Jan 30 '07 #2

P: n/a
_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?
Store time in UTC, and when you display times for the user to read, convert
the UTC time to the time that is currently used in your location, this way you
won't get troubles with CET/CETS.
--

//Aho
Jan 30 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.