Hello,
Hope someone can help as I'm going around in circles with dates, times and time zones.
I'd like to show the sum of durations of certain events in the form of hhh:mm
I have a list (DB) of event names and when they happened and the events could cross time zones, but I've stored the event time as a Tick without the time zone, i.e. when I stored the time I adjusted the time by adding DateTime.TicksPerHour * TimeZoneOffset
When I want to display the totals for each event I go through the list starting at the newest and subtracting the previous list value, this I think should give me the duration of the event in Ticks. I then add this to a total for each event. So I think I have the total number of Ticks (or time) for each event.
I just then need to display in hhh:mm.
I think I'm asking weather it is possible to subtract 2 Tick values to get the difference and then add these differences up? And then if this is OK how would I display the total in hhh:mm format?
An help would be appreciated.
Thanks
Dave
Hope someone can help as I'm going around in circles with dates, times and time zones.
I'd like to show the sum of durations of certain events in the form of hhh:mm
I have a list (DB) of event names and when they happened and the events could cross time zones, but I've stored the event time as a Tick without the time zone, i.e. when I stored the time I adjusted the time by adding DateTime.TicksPerHour * TimeZoneOffset
When I want to display the totals for each event I go through the list starting at the newest and subtracting the previous list value, this I think should give me the duration of the event in Ticks. I then add this to a total for each event. So I think I have the total number of Ticks (or time) for each event.
I just then need to display in hhh:mm.
I think I'm asking weather it is possible to subtract 2 Tick values to get the difference and then add these differences up? And then if this is OK how would I display the total in hhh:mm format?
An help would be appreciated.
Thanks
Dave