I would like to get the current date-time conveniently on the console in standard ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
For example: 2019-07-13T01:09:35Z
I know the date
command displays the current date-time, but not in ISO 8601 format by default. The -I
option shows the date-only portion in standard format. And -Iseconds
displays 2019-07-13T01:18:10+00:00
. That is close, but:
- I would prefer the usual
Z
on the end for an offset of zero, rather than+00:00
. - I would like something shorter to type, for such a basic common task.
My Question here is the same as this one, but for BSD rather than Linux (apparently).