[H-GEN] time in C/C++
Andrae Muys
a.muys at mailbox.uq.edu.au
Mon Dec 27 07:05:34 EST 1999
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Please observe the list's charter. ]
On Sun, 26 Dec 1999, Frank Brand wrote:
> [ Humbug *General* list - semi-serious discussions about Humbug and ]
> [ Unix-related topics. Please observe the list's charter. ]
>
> My query is to asak what people think about the best way of getting the time
> between dates. Originally, I thought to use difftime() but I believe that this
> method can lead to errors under some circumstances.
>
How are you storing the dates interanally? If you're using time_t's then
a simple difference should be sufficient, otherwise my gut feeling is to
convert to time_t do the calculation and convert to days /3600.0 iirc.
Andrae
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Andrae Muys <andrae at humbug.org.au> "Never ascribe to malice that which is
System Programmer adequately explained by incompetence."
The Centre for Magnetic Resonance -Napoleon Bonaparte
The University of Queensland
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.
More information about the General
mailing list