sgreben / tj

stdin line timestamps. single binary, no dependencies. osx & linux & windows. plays well with jq.
230 stars 2 forks source link

ISO8601 format? #4

Closed jlevy closed 6 years ago

jlevy commented 6 years ago

A great idea; been wondering why no one had written a tool like for some time!

One suggestion: It seems ISO8601 is not listed? In general, a good number of engineers believe ISO8601 in Universal timezone is "the one true format" for production timestamps so not having it be easy and obvious to use is a drawback to using a tool. Note you can add subsecond precision in this format too, e.g. 2018-03-26T05:26:50.129Z.

Thanks again!

jlevy commented 6 years ago

See you do have RFC 3339 but that does differ in particular with the non-UTC timezone: https://stackoverflow.com/questions/522251/whats-the-difference-between-iso-8601-and-rfc-3339-date-formats

sgreben commented 6 years ago

Hey! I just added an ISO8601 option in 7.0.0, as well as defaulting to UTC unless "Local" or a different timezone is explicitly specified. The format string for ISO8601 is actually the same as RFC3339 - since we only produce (not parse) timestamps, and RFC3339 output is valid ISO8601 output, this should be fine.

jlevy commented 6 years ago

Cool!