bug-coreutils@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: aaa jjj <ajneu1@gmail.com>
To: 63119@debbugs.gnu.org
Subject: bug#63119: date -Ins has a comma!!
Date: Thu, 27 Apr 2023 16:53:53 +0200	[thread overview]
Message-ID: <CAPgtGZO8K=TmyoonHT8PXxcHW0xpGbkO8syL4T0QoeP7_S9dxg@mail.gmail.com> (raw)

Hi,

is it not a bug, that if I do

LC_ALL=C date -u -Ins

gives me this:
2023-04-27T13:30:15,976772648+00:00

I'm talking about the comma. What is it doing there???
Should this not be a dot instead?

Here's the code:
https://github.com/coreutils/coreutils/blob/35adc746a000ac1f8d1d817a6a3a60d5b80daef5/src/date.c#L465

What does ISO 8601 say about this?

Look at other languages:

node -e 'console.log(new Date().toISOString())'
-> 2023-04-27T13:40:58.846Z

python3 -c 'from datetime import datetime;
print(datetime.now().isoformat())'
-> 2023-04-27T16:23:40.217313

python3 -c 'from datetime import datetime, timezone;
print(datetime.now(timezone.utc).isoformat())'
-> 2023-04-27T14:23:40.228151+00:00

python3 -c 'from datetime import datetime, timezone;
print(datetime.now(timezone.utc).astimezone().isoformat())'
-> 2023-04-27T16:23:40.238908+02:00


PS:
Hell, you cannot simply change it now (backwards-compatibility), but what
about another option flag or whatever...


Thanks.
A

             reply	other threads:[~2023-04-27 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 14:53 aaa jjj [this message]
2023-04-27 18:46 ` bug#63119: date -Ins has a comma!! Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPgtGZO8K=TmyoonHT8PXxcHW0xpGbkO8syL4T0QoeP7_S9dxg@mail.gmail.com' \
    --to=ajneu1@gmail.com \
    --cc=63119@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).