GNU bug report logs - #58599
`date -d $(date)` error for non en_* locale

Previous Next

Package: coreutils;

Reported by: Ruslan Kovtun <koutoftimer <at> gmail.com>

Date: Mon, 17 Oct 2022 23:04:03 UTC

Severity: normal

To reply to this bug, email your comments to 58599 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#58599; Package coreutils. (Mon, 17 Oct 2022 23:04:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ruslan Kovtun <koutoftimer <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 17 Oct 2022 23:04:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ruslan Kovtun <koutoftimer <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: `date -d $(date)` error for non en_* locale
Date: Mon, 17 Oct 2022 17:44:00 +0300
[Message part 1 (text/plain, inline)]
$ date -d "$( date )"
date: invalid date ‘Пн 17 окт 2022 17:34:00 EEST’

$ date -d "Mon 17 oct 2022 17:34:00 EEST"
Пн 17 окт 2022 17:34:00 EEST

According to "do one thing and do it well" and to the fact of '-d/--date'
option existence, `date` should be able to parse its default output in any
locale.
-- 
Yours faithfully,
Ruslan Kovtun.
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#58599; Package coreutils. (Tue, 18 Oct 2022 01:05:02 GMT) Full text and rfc822 format available.

Message #8 received at 58599 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ruslan Kovtun <koutoftimer <at> gmail.com>, 58599 <at> debbugs.gnu.org
Subject: Re: bug#58599: `date -d $(date)` error for non en_* locale
Date: Mon, 17 Oct 2022 18:04:04 -0700
On 10/17/22 07:44, Ruslan Kovtun wrote:
> According to "do one thing and do it well" and to the fact of '-d/--date'
> option existence, `date` should be able to parse its default output in any
> locale.

Patches would be welcome. Good luck getting it to work, though. Many 
date formats are ambiguous, and I don't see how you'd address that.

In the meantime, I suggest sticking to ISO format dates and times with 
UTC, e.g.:

date -d "$(date -u +'%Y-%m-%d %H:%M:%S.%NZ')"




This bug report was last modified 2 years and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.