--- Begin Message ---
Subject: |
date+%-Y -d "- N years" errors when N > 111 |
Date: |
Mon, 15 Apr 2019 15:57:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
I have been using 'date +%-Y -d "- 2010 years" in a script for years but
today after using the script after upgrading to Ubuntu 19.04 it has failed.
After some experimentation it succeeds with upto 111 years but fails
from 112 onwards.
Error given is:
'date: invalid date '- 112 years'.
DistroRelease: Ubuntu 19.04
Package: coreutils 8.30-1ubuntu1
I have already reported the bug in Ubuntu
(https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1824688) but
they have advised me to report it here.
Regards
O. Emmerson
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#35289: date+%-Y -d "- N years" errors when N > 111 |
Date: |
Mon, 15 Apr 2019 09:01:06 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 4/15/19 7:57 AM, O. Emmerson wrote:
> I have been using 'date +%-Y -d "- 2010 years" in a script for years but
> today after using the script after upgrading to Ubuntu 19.04 it has
> failed.
It works for me with coreutils 8.31 on RHEL 7 x86-64:
$ date +%-Y -d "- 2010 years"
9
Most likely you are running on a 32-bit machine, and dates in the year 9
cannot be represented in a 32-bit timestamp. So a simple fix would be
for you to switch to a 64-bit machine.
--- End Message ---