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: Richard Neill
Subject: bug#71986: RFC: date @ to support ms.
Date: Sun, 7 Jul 2024 20:46:45 +0100
User-agent: Mozilla Thunderbird

Hello,

I've noticed a lot of systems now return the timestamp in milliseconds since the epoch, rather than seconds. This means that e.g.

  date --date='@1720378861258'

will do something rather unexpected!

May I suggest that it would be nice if date had an input format that would let me specify that the value is in ms?

I know we can bodge it with bc, or by injecting the decimal, or trimming off the last 3 chars, but that seems inelegant, and requires extra thinking (and hence bugs) from the programmer.
  date --date='@1720378861.258'

Perhaps one of these syntaxes might be suitable?

 date --date='@ms1720378861258'
 date --date='@@1720378861258'
 date --epoch-ms --date='@1720378861258'

Thanks very much,

Richard





reply via email to

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