emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48085: closed (date -d greater than 23 years ago gives error invalid


From: GNU bug Tracking System
Subject: bug#48085: closed (date -d greater than 23 years ago gives error invalid date)
Date: Sat, 19 Feb 2022 23:58:02 +0000

Your message dated Sat, 19 Feb 2022 15:57:16 -0800
with message-id <eb2fbd5c-4424-5ca2-4879-943dbc7b66e8@cs.ucla.edu>
and subject line Re: bug#48085: date -d greater than 23 years ago gives error 
invalid date
has caused the debbugs.gnu.org bug report #48085,
regarding date -d greater than 23 years ago gives error invalid date
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
48085: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=48085
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: date -d greater than 23 years ago gives error invalid date Date: Wed, 28 Apr 2021 20:24:50 +0000 User-agent: Mutt/1.10.1 (2018-07-13)
 
I ran the following expecting it to provide me with the date 35 years
ago

  date -d "now - 35 years"

Instead I received the error:

  date: invalid date ‘now - 35 years’

Testing it further I found that the break point is at 24 years:

$ date --version
date (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
$ date -d "now - 23 years"
Tue Apr 28 03:20:37 PM EST 1998
$ date -d "now - 24 years"
date: invalid date ‘now - 24 years’
$

I compiled from the latest coreutils source and found it to have
the same issue:

$ cd coreutils/src/
$ ./date --version
date (GNU coreutils) 8.32.143-62a7c
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.
$ date "now - 23 years"
date: invalid date ‘now - 23 years’
$ date -d "now - 23 years"
Tue Apr 28 03:21:09 PM EST 1998
$ date -d "now - 24 years"
date: invalid date ‘now - 24 years’
$


I found that this did work on a system running coreutils 8.23 so
something seems to have broken since then. These are all Linux systems
that I've tried this on. The system I tested on was a fresh Ubuntu 21.04
VM.

Linux ubuntu2104 5.11.0-16-generic #17-Ubuntu SMP Wed Apr 14 20:12:43 UTC 2021 
x86_64 x86_64 x86_64 GNU/Linux

Thanks,
Mark
 



--- End Message ---
--- Begin Message --- Subject: Re: bug#48085: date -d greater than 23 years ago gives error invalid date Date: Sat, 19 Feb 2022 15:57:16 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0
On 4/28/21 16:23, Mark Krenz wrote:
So I'm not sure if this is a problem with coreutils or a change in the
zoneinfo database. Any ideas?

This appears to be a problem in the GNU C library, when its mktime deciphers the relatively unusual time zone history of Indiana.

I installed the attached patch into Gnulib and propagated it into Coreutils, so the issue should be fixed in the next release of GNU Coreutils. Eventually this patch should migrate from Gnulib to glibc so that other apps get the fix. Thanks for reporting the issue.

Attachment: 0001-mktime-improve-heuristic-for-ca-1986-Indiana-DST.patch
Description: Text Data


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]