GNU bug report logs - #53982
date (GNU coreutils) 8.30 bug report "17 april 2022 + 37 week 5pm"

Previous Next

Package: coreutils;

Reported by: Stéphane Archer <archerstephane <at> gmail.com>

Date: Sun, 13 Feb 2022 23:46:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53982 in the body.
You can then email your comments to 53982 AT debbugs.gnu.org in the normal way.

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#53982; Package coreutils. (Sun, 13 Feb 2022 23:46:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stéphane Archer <archerstephane <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 13 Feb 2022 23:46:01 GMT) Full text and rfc822 format available.

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

From: Stéphane Archer <archerstephane <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: date (GNU coreutils) 8.30 bug report "17 april 2022 + 37 week 5pm"
Date: Sun, 13 Feb 2022 21:18:55 +0100
[Message part 1 (text/plain, inline)]
Hi,
I hope this is the right place to do my bug report.
please see the following shell input-output:
```
$ date -d "17 april 2022 + 36 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
2022-12-25T17:00:00.0Z
$ date -d "17 april 2022 + 37 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
2022-01-01T17:00:00.0Z
$ date -d "17 april 2022 + 38 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
2023-01-08T17:00:00.0Z
```
as you can see the input "17 april 2022 + 37 week 5pm" makes date return
the wrong output for some unknown reason.

Do I do something wrong?
I use the following version: date (GNU coreutils) 8.30

-- 
Best Regards,

Stephane Archer
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#53982; Package coreutils. (Mon, 14 Feb 2022 08:18:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Stéphane Archer <archerstephane <at> gmail.com>
Cc: 53982 <at> debbugs.gnu.org
Subject: Re: bug#53982: date (GNU coreutils) 8.30 bug report "17 april 2022
 + 37 week 5pm"
Date: Mon, 14 Feb 2022 09:17:51 +0100
On Feb 13 2022, Stéphane Archer wrote:

> $ date -d "17 april 2022 + 36 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
> 2022-12-25T17:00:00.0Z
> $ date -d "17 april 2022 + 37 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
> 2022-01-01T17:00:00.0Z
> $ date -d "17 april 2022 + 38 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
> 2023-01-08T17:00:00.0Z
> ```
> as you can see the input "17 april 2022 + 37 week 5pm" makes date return
> the wrong output for some unknown reason.

It doesn't make sense to use %G without %V, or to use it in place of %Y.

$ date -d "17 april 2022 + 37 week 5pm" +'%G/%V %Y-%m-%dT%H:%M:%S.0Z'
2022/52 2023-01-01T17:00:00.0Z

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-coreutils <at> gnu.org:
bug#53982; Package coreutils. (Mon, 14 Feb 2022 09:43:01 GMT) Full text and rfc822 format available.

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

From: Stéphane Archer <archerstephane <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 53982 <at> debbugs.gnu.org
Subject: Re: bug#53982: date (GNU coreutils) 8.30 bug report "17 april 2022 +
 37 week 5pm"
Date: Mon, 14 Feb 2022 10:41:45 +0100
[Message part 1 (text/plain, inline)]
Hi Andreas,

thank you for your help, I didn't realize I was using the wrong format for
what I wanted.
I don't have much experience with the project.
The format I wanted was: YYYY-MM-DDThh:mm:ss.sZ
is +'%Y-%m-%dT%H:%M:%S.0Z' do what I want or are there still some mistakes
there?

Thank you again and sorry for the bug report, it was late and I was sure to
have found a bug ^^"

Best regards

Stéphane Archer


On Mon, Feb 14, 2022 at 9:17 AM Andreas Schwab <schwab <at> linux-m68k.org>
wrote:

> On Feb 13 2022, Stéphane Archer wrote:
>
> > $ date -d "17 april 2022 + 36 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
> > 2022-12-25T17:00:00.0Z
> > $ date -d "17 april 2022 + 37 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
> > 2022-01-01T17:00:00.0Z
> > $ date -d "17 april 2022 + 38 week 5pm" +'%G-%m-%dT%H:%M:%S.0Z'
> > 2023-01-08T17:00:00.0Z
> > ```
> > as you can see the input "17 april 2022 + 37 week 5pm" makes date return
> > the wrong output for some unknown reason.
>
> It doesn't make sense to use %G without %V, or to use it in place of %Y.
>
> $ date -d "17 april 2022 + 37 week 5pm" +'%G/%V %Y-%m-%dT%H:%M:%S.0Z'
> 2022/52 2023-01-01T17:00:00.0Z
>
> --
> Andreas Schwab, schwab <at> linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
>


-- 
Best Regards,

Stephane Archer
[Message part 2 (text/html, inline)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Mon, 14 Feb 2022 19:03:01 GMT) Full text and rfc822 format available.

Notification sent to Stéphane Archer <archerstephane <at> gmail.com>:
bug acknowledged by developer. (Mon, 14 Feb 2022 19:03:01 GMT) Full text and rfc822 format available.

Message #16 received at 53982-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Stéphane Archer <archerstephane <at> gmail.com>
Cc: 53982-done <at> debbugs.gnu.org
Subject: Re: bug#53982: date (GNU coreutils) 8.30 bug report "17 april 2022 +
 37 week 5pm"
Date: Mon, 14 Feb 2022 11:02:27 -0800
On 2/14/22 01:41, Stéphane Archer wrote:
> is +'%Y-%m-%dT%H:%M:%S.0Z' do what I want

To format an arbitrary timestamp you want "+%Y-%m-%dT%H:%M:%S.%1NZ", 
unless you always want a zero after the period.

Closing the bug report as there's no bug here.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Mar 2022 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 98 days ago.

Previous Next


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