Page MenuHomeFreeBSD

date: attempt to more accurately describe year limitations with -v
ClosedPublic

Authored by kevans on May 31 2022, 4:31 AM.
Tags
None
Referenced Files
F83199894: D35360.id107458.diff
Tue, May 7, 2:59 PM
Unknown Object (File)
Mar 15 2024, 12:49 PM
Unknown Object (File)
Mar 15 2024, 12:49 PM
Unknown Object (File)
Mar 15 2024, 12:49 PM
Unknown Object (File)
Mar 15 2024, 12:48 PM
Unknown Object (File)
Mar 8 2024, 2:25 AM
Unknown Object (File)
Mar 7 2024, 8:35 AM
Unknown Object (File)
Feb 6 2024, 11:01 PM

Details

Summary

The previous description was both incorrect and incomplete in its
description -- the 2038 limit doesn't apply on !i386 platforms, and
it didn't note that values above 100 are accepted and interpreted
differently. Further, it didn't note that absolute years are accepted.

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

pauamma_gundo.com added inline comments.
bin/date/date.1
232

Just to confirm: other 32-bit architectures (ARM, MIPS, PowerPC) have the extended year range that I assume means time_t is 64 bits long?

233–234
235–236
237

Do you mean "in the 4-digit or longer year format"? If you do:

  • I'd move "absolute" to the second "year".
  • How does date decide whether 1905 means Gregorian year 1905 (absolute) or Gregorian year 1900 + 1905 = 3805 (relative to 1900)? Since 1905 is greater than 100, both interpretations are compatible with the language of your draft change.
This revision now requires changes to proceed.May 31 2022, 5:14 AM
bin/date/date.1
232

Correct, i386 is the only supported platform with a 32-bit time_t

237

4-digits are interpreted as a relative year up to and including the start of the tm_year, which is 1900 -- after that, it's just 'the desired year'. i.e., '1900y' is always 1900+1900, '1901y' and later are always the year specified.

kevans marked 5 inline comments as done.

Address review feedback (sorry for the delay)

No worry. I'm swamped anyway.

This revision is now accepted and ready to land.Jun 9 2022, 11:37 PM