I'd like to compute the time difference between two time/date
stamps. The inputs will be in the format of yyyymmdd hh:mm:ss.
Is there anything easier than computing the number of days
difference, converting to seconds, then adding the time difference,
and adjusting for partial days (e.g. if end-time is less than
start-time, subtract one day)?
I'd think this was a common operation, so someone has likely
already written and debugged code I could use. But if the answer is
in the newsgroup, my search hasn't found it.
(It probably wouldn't take me too long to write the code, but
then there's the problem in coming up with weird test examples to make
sure it's correct. I've decided that I'll probably ignore the
problems introduced by DST.)
In case it makes a difference, I'm using Regina on Windows.
--
Arthur T. - ar23hur "at" intergate "dot" com
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 376 |
Nodes: | 16 (3 / 13) |
Uptime: | 25:29:36 |
Calls: | 8,036 |
Calls today: | 6 |
Files: | 13,034 |
Messages: | 5,829,274 |