Add display hint to output u64 as ISO8601 time#617
Conversation
japaric
left a comment
There was a problem hiding this comment.
Implementation looks good to me! Thinking more about it, the + specifier is a bit cryptic and it would be hardcoded to milliseconds. One may want to specify the timestamp in microseconds or some other resolution. So, I think we may want to call this one iso8601ms to differentiate from other possible future display hints. Thoughts?
Is |
|
The Adapting the display hint to |
My problem isn't actually the length, but I feel that it is rather cryptic. I definitely would need to look it up if I am seeing it in some elses code. And I would prefer "intuitiveness" over "shortness". Other options I am thinking about are:
Or on the short side:
But none of them seems really good. |
|
@Urhengulas, from your list |
Just go with your preferred one, then 😁 |
* split into two separate display hints, `:iso8601ms` for milliseconds & `:iso8601s` for seconds precision (similar to chrono)
089438a to
3cf29c6
Compare
* incorporate review feedback * update `chrono` dependency * fix naming
|
bors d+ |
|
✌️ justahero can now approve this pull request. To approve and merge a pull request, simply reply with |
|
bors r+ |
|
Build succeeded: |
This PR implements #451.
The following log statement prints the given timestamp in milliseconds as a ISO8601 datetime without a timezone.
Alternatively to log a
u64as a ISO8601 datetime in seconds use the:iso8601sdisplay hint