Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.comp.hardware.pc-homebuilt > #35509
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | alt.comp.hardware.pc-homebuilt, comp.lang.c, comp.lang.ada, comp.programming, alt.os.linux.ubuntu |
| Subject | Re: 'Leap Second' to Be Added on New Year's Eve This Year |
| Date | 2017-01-02 15:38 -0800 |
| Organization | None to speak of |
| Message-ID | <lnzij9uj6v.fsf@kst-u.example.com> (permalink) |
| References | <o3gl85$j26$1@dont-email.me> <GoGdnf_on-zkYfTFnZ2dnUU7-X3NnZ2d@earthlink.com> <lnpok5x5tz.fsf@kst-u.example.com> <zNudnUt2Lts1UffFnZ2dnUU7-WHNnZ2d@earthlink.com> |
Cross-posted to 5 groups.
Dänk 42Ø <dank@nugget.org> writes:
> On 01/02/2017 07:46 AM, Keith Thompson wrote:
[...]
>> The system clock was probably adjusted gradually during the period
>> before and after the leap second.
>
> But since computers store files with Unix time strings, how is is that
> a recently saved file shows the correct current time and is not 37
> seconds off?
In fact the timestamp of a file created in 1970 *is* 37 seconds off.
I don't have any files that old, but the timestamp of a file created
in 2016 is now 1 second off, and will be 2 seconds off after the
next leap second.
I'll bet you didn't notice. As long as timestamps are monotonically
increasing, it doesn't significantly matter.
If you need to record timestamps from several years ago with higher
precision, and allowing for leap seconds, there are other time
representations you can use. It just happens that Unix filesystems
don't typically use them (though it's entirely possible that there
are some I don't know about that do).
Relevance to C: The C standard says only that time_t, the type
returned by the time() function, is a real time (integer or
floating-point) capable of representing times. POSIX specifically
says that leap seconds are ignored. This implies, for example,
that time(NULL) % 3600 is the number of seconds since the top of
the hour, and that system software doesn't have to allow for past
leap seconds (which would be inconvenient) or future leap seconds
(which would be impossible).
[...]
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to alt.comp.hardware.pc-homebuilt | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
'Leap Second' to Be Added on New Year's Eve This Year "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-12-22 21:43 +0800
Re: 'Leap Second' to Be Added on New Year's Eve This Year Siri Cruise <chine.bleu@yahoo.com> - 2016-12-22 05:48 -0800
Re: 'Leap Second' to Be Added on New Year's Eve This Year "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-12-22 22:09 +0800
Re: 'Leap Second' to Be Added on New Year's Eve This Year Krzysztof Mitko <invalid@kmitko.at.list.dot.pl> - 2016-12-24 13:47 +0100
Re: 'Leap Second' to Be Added on New Year's Eve This Year Siri Cruise <chine.bleu@yahoo.com> - 2016-12-24 05:39 -0800
Re: 'Leap Second' to Be Added on New Year's Eve This Year Mark Lloyd <not@mail.invalid> - 2016-12-22 14:31 -0600
Re: 'Leap Second' to Be Added on New Year's Eve This Year Mark Storkamp <mstorkamp@yahoo.com> - 2016-12-23 08:34 -0600
Re: 'Leap Second' to Be Added on New Year's Eve This Year "J-P. Rosen" <rosen@adalog.fr> - 2016-12-23 16:55 +0100
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James R. Kuyper" <jameskuyper@verizon.net> - 2017-01-03 20:46 -0500
Re: 'Leap Second' to Be Added on New Year's Eve This Year Jason <jason_warren@ieee.DELETE.org> - 2016-12-22 17:14 -0500
Re: 'Leap Second' to Be Added on New Year's Eve This Year "Jonathan N. Little" <lws4art@gmail.com> - 2016-12-22 17:40 -0500
Re: 'Leap Second' to Be Added on New Year's Eve This Year Jason <jason_warren@ieee.org> - 2016-12-23 19:57 -0500
Re: 'Leap Second' to Be Added on New Year's Eve This Year Char Jackson <none@none.invalid> - 2016-12-23 21:44 -0600
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James Wilkinson Sword" <imvalid@somewear.com> - 2016-12-31 23:42 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James Wilkinson Sword" <imvalid@somewear.com> - 2016-12-31 21:57 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James R. Kuyper" <jameskuyper@verizon.net> - 2017-01-03 20:06 -0500
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James Wilkinson Sword" <imvalid@somewear.com> - 2017-01-04 15:44 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James R. Kuyper" <jameskuyper@verizon.net> - 2017-01-04 14:11 -0500
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James Wilkinson Sword" <imvalid@somewear.com> - 2017-01-04 19:58 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year Richard Heathfield <rjh@cpax.org.uk> - 2017-01-04 16:17 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James Wilkinson Sword" <imvalid@somewear.com> - 2017-01-04 21:03 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year Larc <larc@notmyaddress.com> - 2017-01-04 16:32 -0500
Re: 'Leap Second' to Be Added on New Year's Eve This Year "Osmium" <r124c4u102@comcast.net> - 2017-01-05 14:15 -0600
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James Wilkinson Sword" <imvalid@somewear.com> - 2017-01-06 01:26 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year raltbos@xs4all.nl (Richard Bos) - 2017-01-09 17:12 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year Har-dee-har-har <YouMustBeKidding@This.Com> - 2017-01-09 09:53 -0800
Re: 'Leap Second' to Be Added on New Year's Eve This Year "J-P. Rosen" <rosen@adalog.fr> - 2017-01-10 07:20 +0100
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James Wilkinson Sword" <imvalid@somewear.com> - 2017-01-12 23:17 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year Tim <timothybil@yahoo.com> - 2017-01-13 00:51 -0600
Re: 'Leap Second' to Be Added on New Year's Eve This Year antispam@math.uni.wroc.pl - 2017-01-05 19:28 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James Wilkinson Sword" <imvalid@somewear.com> - 2017-01-05 21:41 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year Dänk 42Ø <dank@nugget.org> - 2017-01-02 07:08 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year Keith Thompson <kst-u@mib.org> - 2017-01-01 23:46 -0800
Re: 'Leap Second' to Be Added on New Year's Eve This Year Dänk 42Ø <dank@nugget.org> - 2017-01-02 21:56 +0000
Re: 'Leap Second' to Be Added on New Year's Eve This Year Keith Thompson <kst-u@mib.org> - 2017-01-02 15:38 -0800
Re: 'Leap Second' to Be Added on New Year's Eve This Year "James R. Kuyper" <jameskuyper@verizon.net> - 2017-01-03 20:26 -0500
csiph-web