git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Call timegm and timelocal with 4-digit year

From
BWBernhard M. Wiedemann <bwiedemann@suse.de>
Date
Feb 26, 2018, 10:59 UTC
Message-ID
<81704602-1c81-f46c-f306-968147327e74@suse.de>
In-Reply-To
<87tvu6dntx.fsf@evledraar.gmail.com>
On 2018-02-24 23:28, Ævar Arnfjörð Bjarmason wrote:
> My Time::Local 1.2300 on perl 5.024001 currently interprets "69" here as
> 1969, but after this it'll be 2069.
on one hand, there is already
perl -e 'use Time::Local;
  print scalar gmtime(Time::Local::timegm(0,0,0,1,0,68))'
Sun Jan  1 00:00:00 2068

The problem here is the 'currently', because in 11 months from now, 69 will be interpreted as 2069 by Time::Local, too.

faketime 2019-01-01 perl -e 'use Time::Local;
   print scalar gmtime(Time::Local::timegm(0,0,0,1,0,69))'
Tue Jan  1 00:00:00 2069

We could compromize for $y+=100 if $y<69;

to freeze the behaviour to what Time::Local does in 2018, but then there might not be actual repos with such 2-digit year timestamps.

There are definitely CVS repos from before 1999 and without this change, those might be misinterpreted in 2049 (or before, depending on age)

Previous: Ævar Arnfjörð Bjarmason
Message 4 of 4 in “Call timegm and timelocal with 4-digit year”
  1. Call timegm and timelocal with 4-digit yearBernhard M. Wiedemann, Feb 23, 2018
  2. Junio C HamanoFeb 23, 2018
  3. Ævar Arnfjörð BjarmasonFeb 24, 2018
  4. Bernhard M. WiedemannFeb 26, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.