I hope this isn't just because I'm too tired to think straight any more but here goes:
My app logs events, and timestamps them with a long integer. In order to work out the interval between two events I'm trying to subtract one from the other and output the difference, like this:
By my calculations, that comes to around 11 seconds. But instead of getting 00:00:11, I get 01:00:11.
Can anyone explain why this is happening?
Joined: Jul 04, 2005
Paul- I don't have access to Time to test- but could it be the locale is the problem? If you pass in the start and end values they do seem 11 seconds apart. Maybe try passing those into Time and printing.
Joined: Jul 23, 2005
Thanks for the suggestion Tom. I think I know whats happening now.
The Time class is a 24 hour clock that starts at 01:00:00. So if you create a Time object and initialise it with 0, you get 01:00:00. If you create a Time object and initialise it with 3600000 (one hour in milliseconds), you get 02:00:00, etc.
This means that this class is no use to me, as it wraps round after 24 hours. Guess I'll just have to do some work and write my own formatting code <sigh>.