473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
2 2599
_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
_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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Fran?ois Laroche | last post by:
hey guys, I know that you will tell me that's easier to do in php or even in asp, but I just dont have the time to learn it 1- I need a javascript that will show the date of tomorrow 2- I need a...
38
by: | last post by:
I have a script... ----- <SCRIPT language="JavaScript" type="text/javascript"> <!-- function makeArray() { for (i = 0; i<makeArray.arguments.length; i++) this = makeArray.arguments; } ...
12
by: Michael B Allen | last post by:
Are there any localized facilites for performing date arithmetic that properly considers leap years, daylight savings time, and whatever other peculiarities of the gregorian lunar calendar? ...
3
by: Richard | last post by:
Hi, Is there any way to get the time difference between Central(US) and GMT in vb.net. I'll appreciate your help/suggestion. Thanks RC
4
by: jamesyreid | last post by:
Hi, I'm really sorry to post this as I know it must have been asked countless times before, but I can't find an answer anywhere. Does anyone have a snippet of JavaScript code I could borrow...
37
by: David T. Ashley | last post by:
I have Red Hat Enterprise Linux 4. I was just reading up about UTC and leap seconds. Is it true on my system that the Unix time may skip up or down by one second at midnight when there is a...
7
by: David E. Ross | last post by:
My Web site is hosted by my ISP on an Apache server. Some of my pages display dynamic "Last Updated" dates by using the LAST_MODIFIED environment variable in the following SSI: <!--#config...
3
by: Steve | last post by:
I am trying to calculate elapsed travel times for flights. My plan is to enter the local departure time, the departure city and the local arrival time and city. These times would be standardised...
15
by: student4lifer | last post by:
Hello, I have 2 time fields dynamically generated in format "m/d/y H:m". Could someone show me a good function to calculate the time interval difference in minutes? I played with strtotime() but...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.