Project

General

Profile

Actions

Bug #6749

closed

rdoc of Time class (incorrect explanation of leap seconds)

Added by stomar (Marcus Stollsteimer) almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p243 (2012-06-28 revision 36244) [i686-linux]
Backport:
[ruby-core:46535]

Description

The patch fixes the documentation of Time#sec,
where an incorrect explanation of leap seconds is given.


Files

time_rdoc_explanation_of_leap_seconds.patch (860 Bytes) time_rdoc_explanation_of_leap_seconds.patch stomar (Marcus Stollsteimer), 07/18/2012 05:13 AM
Actions #1

Updated by drbrain (Eric Hodel) almost 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r36507.
Marcus, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • time.c (time_sec): Updated description of leap seconds for accuracy.
    Based on patch by Marcus Stollsteimer. [Bug #6749]

Updated by drbrain (Eric Hodel) almost 12 years ago

I added a note that UTC is based on solar time to describe what "not exactly 86400 seconds" meant and a link to Wikipedia's leap second page to your patch.

Updated by stomar (Marcus Stollsteimer) over 11 years ago

Hi Eric,

The point is, that UTC is not based on solar time, and this is the
reason that leap seconds are needed.

UTC is based on the International Atomic Time (ITA) and therefore
on the SI second definition. (A day is not exactly 86400 SI seconds
long, so to avoid that mean solar time and UTC differ too much,
leap seconds were introduced.)

Please change "is based on solar time" to "is based on atomic time".

Am 24.07.2012 00:25, schrieb drbrain (Eric Hodel):

Issue #6749 has been updated by drbrain (Eric Hodel).

I added a note that UTC is based on solar time to describe what "not exactly 86400 seconds" meant and a link to Wikipedia's leap second page to your patch.

Bug #6749: rdoc of Time class (incorrect explanation of leap seconds)
https://bugs.ruby-lang.org/issues/6749#change-28353

Author: stomar (Marcus Stollsteimer)
Status: Closed
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category:
Target version:
ruby -v: ruby 1.9.3p243 (2012-06-28 revision 36244) [i686-linux]

The patch fixes the documentation of Time#sec,
where an incorrect explanation of leap seconds is given.

--
https://github.com/stomar/

Updated by drbrain (Eric Hodel) over 11 years ago

On Jul 23, 2012, at 11:52 PM, wrote:

UTC is based on the International Atomic Time (ITA) and therefore on the SI second definition. (A day is not exactly 86400 SI seconds long, so to avoid that mean solar time and UTC differ too much,
leap seconds were introduced.)

Please change "is based on solar time" to "is based on atomic time".

The UTC second is the same as the SI second and tracks TAI, but is not allowed to drift from UT1 by more than 0.9 seconds. This makes both statements true, but in different senses. (TAI for second duration and count, UT1 for daily human-scheduled activities)

Since we're talking about leap seconds here, the solar time reference seems most relevant. How about I change "is based on" to "tracks"? The Wikipedia reference should allow users to learn all the details.

Updated by stomar (Marcus Stollsteimer) over 11 years ago

Am 24.07.2012 19:44, schrieb Eric Hodel:

On Jul 23, 2012, at 11:52 PM, wrote:

UTC is based on the International Atomic Time (ITA) and therefore on the SI second definition. (A day is not exactly 86400 SI seconds long, so to avoid that mean solar time and UTC differ too much,
leap seconds were introduced.)

Please change "is based on solar time" to "is based on atomic time".

The UTC second is the same as the SI second and tracks TAI, but is not allowed to drift from UT1 by more than 0.9 seconds. This makes both statements true, but in different senses. (TAI for second duration and count, UT1 for daily human-scheduled activities)

Since we're talking about leap seconds here, the solar time reference seems most relevant. How about I change "is based on" to "tracks"? The Wikipedia reference should allow users to learn all the details.

From a physicist's point of view, the statement that

"This allows the system to inject leap seconds every now and then to
 correct for the fact that UTC tracks [is based on] solar time so
 days are not exactly 86400 seconds or 24 hours long"

would simply be plain wrong. If UTC really would track solar time
the days would be exactly 86400 seconds long and there would be
no need for leap seconds. (This is the more or less the principle behind
the "Universal Time" UT1.)

UTC and TAI run perfectly in parallel, with the same, well defined
SI second as basis. They only differ by an exactly known amount of
seconds (the accumulated leap seconds).

UT1 does not even have an exactly defined length of a second:
it varies with the irregular rotation speed of the earth.
(Furthermore, the mean solar second is longer than the SI second.)
So, there is no exactly predictable relation between UTC and UT1.
The difference between the two times is constantly fluctuating, and
can only be determined in retrospect from astronomical observations.

So, the principles behind UTC and solar time are completely different.
Yes, they are related in the sense that the difference is kept below
0.9 seconds, but this influence of solar time on UTC has to be seen
as a correction, not as the basis of it.

Proposal: either (in order of preference)

  1. correct to "...is based on atomic time..."

  2. correct to "is based on the SI definition of the second and
    days are not exactly 86400 SI seconds or 24 hours long"

  3. correct to "...is not based on solar time..."

  4. leave out the explanation and link completely

Best regards,
Marcus

--
https://github.com/stomar/

Updated by drbrain (Eric Hodel) over 11 years ago

On Jul 25, 2012, at 6:24 AM, wrote:

[…]

Ok, you have convinced me.

Proposal: either (in order of preference)

  1. correct to "...is based on atomic time..."

  2. correct to "is based on the SI definition of the second and
    days are not exactly 86400 SI seconds or 24 hours long"

  3. correct to "...is not based on solar time..."

Since the leap seconds are added to put the sun roughly overhead when 12:00 rolls around, none of these seem to relate to "why leap seconds?" in a direct way without a few more sentences about TAI, UT1, UTC and their relationships.

  1. leave out the explanation and link completely

I'll go with this last option. I think using Wikipedia's definition is preferable to maintaining our own.

Updated by stomar (Marcus Stollsteimer) over 11 years ago

Am 25.07.2012 19:36, schrieb Eric Hodel:

On Jul 25, 2012, at 6:24 AM, wrote:

  1. leave out the explanation and link completely

I'll go with this last option. I think using Wikipedia's definition is preferable to maintaining our own.

I agree... the Ruby documentation is neither the right place to
elaborate on physics (sigh...) nor a link collection.

Regards,
Marcus

--
https://github.com/stomar/

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0