Handling DST dates
I am trying to determine the total number of minutes from the start of the day until the <date> value. For example, if the 00 hour of the current date was:
Case 1:
basedate: 2010-11-07T00:00:00.000-06:00
<date>2010-11-07T01:00:00.000-05:00</date> //should return 00 min
<date>2010-11-07T01:00:00.000-06:00</date> //should return 60 min
Case 2:
basedate: 2010-11-07T00:00:00.000-05:00
<date>2010-11-07T01:00:00.000-05:00</date> //should return 60 min
<date>2010-11-07T01:00:00.000-06:00</date> //should return 120 min
My two questions are:
1. Is there a way to capture the current dateTime and reset the object to the 00 hour?
2. Once I have a base dateTime set at the 00 hour of the current day, I am able to take the difference of the base dateTime and the <date> value, but is there a way to calculate the total minutes of that difference? All I can think of is to use built in functions to get the hours, multiple by 60 and add the minutes. I just wasn't sure if there was a more efficient method.
Any help is greatly appreciated.
|