[H-GEN] time in C/C++

Raymond Smith raymonds at uq.net.au
Tue Dec 28 23:07:45 EST 1999


[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics.  Please observe the list's charter.          ]

On Wed, 29 Dec 1999, Anthony Towns wrote:
> time_t's ignore leap seconds. (If you're doing stuff with times *during*
> a leap second, and you're using ntp or something similar that will tell you
> about leap seconds, your time will go from 23:59:59 to 23:59:60 to 23:00:00,
> with the time_t's of the latter two being the same.

Is this also from the POSIX.1 standard? I only ask because, the Solaris
2.7's time(2) entry is silent about leap seconds, as is Stevens. It is
also interesting that converting from a time_t into a tm using gmtime or
localtime _does_ include leap seconds. Although, it would not surprise me
if time_t did not include leap seconds while tm did.
 
> Note: *all* years divisible by 4 are leap years. No 100 or 400 rule.

Hmm. Another reason not to use time_ts to store dates perhaps? I wonder
how date(1) handles things...

Raymond

---
raymond at humbug.org.au                     All that we see, or seem,
                                    Is but a dream, within a dream.


--
* 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