Re: maximum day of month
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Wed, 22 Jul 2009 12:58:11 -0500
On Wed, 22 Jul 2009 12:45:52 -0400, r norman <r_s_norman@xxxxxxxxxxx>
wrote:
We may have starting
talking about clock_t and time_t but there is a historic reason why
time_t used only 31 bits in many implementations.
Wiki says:
http://en.wikipedia.org/wiki/Unix_time
<q>
There was originally some controversy over whether the Unix time_t should
be signed or unsigned. If unsigned, its range in the future would be
doubled, postponing the 32-bit overflow (by 68 years). However, it would
then be incapable of representing times prior to 1970. Dennis Ritchie, when
asked about this issue, said that he hadn't thought very deeply about it,
but was of the opinion that the ability to represent all times within his
lifetime would be nice. (Ritchie's birth, in 1941, is around Unix time
-893,400,000.) The consensus is for time_t to be signed, and this is the
usual practice. The software development platform for version 6 of the QNX
operating system has an unsigned 32-bit time_t, though older releases used
a signed type.
</q>
It sounds like it was more of a functional choice than being constrained by
the unavailability of unsigned integers. Then again, I've never used a
Standard C implementation that defined any negative value for time_t other
than -1, so I don't know how accurate this Wiki article is. I would guess
they're not talking about "time_t" but instead whatever type Ritchie used
when he created Unix.
Wikipedkia states:
" ISO C defines time_t as an arithmetic type, but does not specify any
particular type, range, resolution, or encoding for it".
http://en.wikipedia.org/wiki/Time_t
Which is basically what I said earlier, less the bit about "arithmetic
type", which is a technical term I didn't feel like defining.
--
Doug Harrison
Visual C++ MVP
.
- References:
- Re: maximum day of month
- From: David Webber
- Re: maximum day of month
- From: Hans-J . Ude
- Re: maximum day of month
- From: Joseph M . Newcomer
- Re: maximum day of month
- From: Luke Alcatel
- Re: maximum day of month
- From: Doug Harrison [MVP]
- Re: maximum day of month
- From: Joseph M . Newcomer
- Re: maximum day of month
- From: Doug Harrison [MVP]
- Re: maximum day of month
- From: r norman
- Re: maximum day of month
- From: Doug Harrison [MVP]
- Re: maximum day of month
- From: r norman
- Re: maximum day of month
- Prev by Date: Re: Deleting DCs to avoid resource leak
- Next by Date: Re: Deleting DCs to avoid resource leak
- Previous by thread: Re: maximum day of month
- Next by thread: Re: maximum day of month
- Index(es):
Relevant Pages
|