bug-coreutils
[Top][All Lists]
Advanced

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

bug#71986: RFC: date @ to support ms.


From: Paul Eggert
Subject: bug#71986: RFC: date @ to support ms.
Date: Tue, 9 Jul 2024 02:52:08 +0200
User-agent: Mozilla Thunderbird

On 7/8/24 21:18, Richard Neill wrote:
Also, this is an increasingly common format to see as an input

In shell apps? News to me. I thought it was more of a Java and/or JavaScript thing. Those languages love ms. POSIX, though, prefers ns.

For occasional use one can just use the shell, with no new option needed. For your example:

$ ms=1720378861258
$ date -d@${ms%???}
Sun Jul  7 21:01:01 CEST 2024

But really, it's better to use a decimal point, as Andreas suggested. Simple, clear, unambiguous, and no new option needed regardless of whether the timestamps have ms or μs or ns resolution.


for date-input, this:
   date --date '1/2/2024'
is ambiguous

It's ambiguous without context, yes, but the manual documents it so that provides the context.

https://www.gnu.org/software/coreutils/manual/html_node/Calendar-date-items.html

In GNU projects man pages are typically just quick summaries: for the details you need the manual.





reply via email to

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