error in NOTES section in time(2)
Hello,
The NOTES section of time(2) <http://www.kernel.org/doc/man-pages/online/pages/man2/time.2.html> says the following:
"POSIX.1 defines seconds since the Epoch as a value to be interpreted as the number of seconds between a specified time and the Epoch, according to a formula for conversion from UTC equivalent to conversion on the naive basis that leap seconds are ignored and all years divisible by 4 are leap years."
I have neither read nor checked the POSIX specification, but there is an oddity in the statement, because "Years that are evenly divisible by 100 are not leap years, unless they are also evenly divisible by 400, in which case they are leap years." - http://en.wikipedia.org/wiki/Leap_year and cited sources.
So if POSIX really says that an average year has 365.25 days, a note should be added to the manual saying that POSIX differs from the Gregorian calendar. If, however, an average year has 365.2425 days according to POSIX, the line in time(2) should be updated to reflect that.
Regards,
Alexander Schuch
Signature · 6 lines
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hello Alexander,
Quoted 17 lines · Alexander Schuch
Hello,
The NOTES section of time(2) <http://www.kernel.org/doc/man->
pages/online/pages/man2/time.2.html> says the following:"POSIX.1 defines seconds since the Epoch as a value to be interpreted as the number of seconds between a specified time and the Epoch, according to a formula for conversion from UTC equivalent to conversion on the naive basis that leap seconds are ignored and all years divisible by 4 are leap years."
I have neither read nor checked the POSIX specification, but there is an oddity in the statement, because "Years that are evenly divisible by 100 are not leap years, unless they are also evenly divisible by 400, in which case they are leap years." -
http://en.wikipedia.org/wiki/Leap_year and cited sources.
Quoted 5 lines
So if POSIX really says that an average year has 365.25 days, a note should be added to the manual saying that POSIX differs from the Gregorian calendar. If, however, an average year has 365.2425 days according to POSIX, the line in time(2) should be updated to reflect that.
Thanks for your report. Your estimation that the man page is odd is of course correct. For man-pages-3.33, I applied the patch below.
Cheers,
Michael
man2/time.2 +11 -9
@@ -26,7 +26,7 @@ .\" Modified Sat Jul 24 14:13:40 1993 by Rik Faith <[email protected]> .\" Additions by Joseph S. Myers <jsm28-KWPb1pKIrIJaa/[email protected]>, 970909 .\" -.TH TIME 2 2010-02-25 "Linux" "Linux Programmer's Manual" +.TH TIME 2 2011-09-09 "Linux" "Linux Programmer's Manual" .SH NAME time \- get time in seconds .SH SYNOPSIS
@@ -61,16 +61,18 @@ POSIX does not specify any error conditions. .SH NOTES POSIX.1 defines .I seconds since the Epoch -as a value to be interpreted as the number of seconds between a -specified time and the Epoch, according to a formula for conversion -from UTC equivalent to conversion on the naive basis that leap -seconds are ignored and all years divisible by 4 are leap years. +using a formula that approximates the number of seconds between a +specified time and the Epoch. +This formula takes account of the facts that +all years that are evenly divisible by 4 are leap years, +but years that are evenly divisible by 100 are not leap years +unless they are also evenly divisible by 400, +in which case they are leap years. This value is not the same as the actual number of seconds between the time -and the Epoch, because of leap seconds and because clocks are not +and the Epoch, because of leap seconds and because system clocks are not required to be synchronized to a standard reference. -The intention is -that the interpretation of seconds since the Epoch values be -consistent; see POSIX.1 Annex B 2.2.2 for further rationale. +The intention is that the interpretation of seconds since the Epoch values be +consistent; see POSIX.1-2008 Rationale A.4.15 for further rationale. .SH "SEE ALSO" .BR date (1), .BR gettimeofday (2),
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html