[LEAPSECS] POSIX Time

M. Warner Losh imp at bsdimp.com
Sun Oct 11 20:39:33 EDT 2009


In message: <4AD22CDB.8050402 at rubidium.dyndns.org>
Magnus Danielson <magnus at rubidium.dyndns.org> writes:

: Joe,

:

: >> So in many ways UTC and time_t are only superficially similar things.

: >> time_t is a half-assed attempt to do the right thing for time. It

: >> generally works for most people most of the time, but is wrong where

: >> it doesn't match reality.

: >

: > POSIX Time (time_t) solves the problems it was intended to solve, but

: > may be half-assed in the context of problems that it was never intended

: > to solve. The issue is not that POSIX Time is right or wrong, but that

: > it is misapplied. Screwdrivers don't make very good chisels, and

: > chisels don't make very good screwdrivers, even if each is the best of

: > its kind.

:

: The trouble is that it is the only basic tool provided, it looks like

: "time" to most than a few and no directions was given to what needs to

: be done if propper time is needed. Being the wrong tool but the only

: tool, we get forced to use it anyway.

:

: We still need to figure out a good way to resolve the issue and let

: there be a method by which it can be implemented.


The basic problem isn't that time_t made time keeping simple for most
users. The basic problem is that it made it impossible to do
correctly for those users that care or are forced to care by statute.
Most programmers, when they first approach time_t, think that it is
the same thing as UTC so adopt it without thinking. It is only when
the subtle differences come to light, say during conformance testing,
do people start to realize that it was the wrong tool.

To use a wood working analogy. It is the wrong screwdriver for the
job. This isn't a pounding screws analogy. Rather, it is trying to
use the wrong flat blade to drive the screw. It usually looks like it
works, but because the slot and the blade aren't well matched,
slippage can occur and mar the wood... And by then, you <sometimes>
have to redo the whole piece because of the mismatch.

Warner


More information about the LEAPSECS mailing list