Linux "date" command ignores leap-seconds?

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Jan 15 16:36:50 UTC 2013


On Mon, Jan 14, 2013 at 10:08:13PM -0500, Bob Jonkman wrote:
> Depends on what you're doing.  Yes, the wall clock needs to stand still
> for a second to keep up with Earth's rotation, but the timer that tells
> me how long a process is running needs to keep running during a leap
> second.  If I ask how much time has elapsed since 1 January 1970 the
> 'date' command appears to give the wrong answer by not counting the leap
> seconds.
> 
> Does it matter? Depends on what you're doing, and how accurate you need
> to be.

Well as far as I know the decision has been that unix timstamps do
not account for leap seconds.  So if you happen to care, you can't use
unix timestamps without additional information and adjusting.  Most things
don't care, so keeping unix timestamps simple makes sense.

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list