Walter Meester
HoogkarspelNetherlands
>>Hi peter,
>>
>>>>>>
>>>>>>A client called about an incorrect calculation of the time (hrs) between two events. I was calculating the time by using ROUND(DateTime2 - DateTime1)/3600,0). However this does not take into account change of time because of daylight savings.
>>>>>>
>>>>>>I'm aware that Windows does store the date and time somewhere on which the daylight saving time change happens. It needs to pick it up from the regional settings as the software is running in many different countries, with and without daylight savings.
>>>>>>
>>>>>>Is there an easy way of calcutating the number of hours between two events and taking day light savings into account.
>>>>>
>>>>>Suppose datetime1 has been stored in summertime and datetime2 12 REAL hours later in wintertime. Are you implying that your calculation shows 12 hours difference?
>>>>
>>>>No, I'm implying that the calculation shows 35 hours while it should have been 36 hrs.
>>>
>>>Please use my example. If datetime2 is 12 real hours later, what does your calculation show?
>>
>>Your example will show 11 hours difference, while it should have been saying 12.
>
>So, it's actually taking day light savings into account. And you are interested in a calculation that does NOT take them into account, right? Then I understand your problem. Do you already have the solution?
Not really, In order to solve this particular problem I need to go into the API.... I did not have the time yet. I was hoping someone has dealt with it before, now I have to work on my own solution.
Walter,
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only