Date/Time conversions on the command line
Frequently, but not frequent enough for simply remembering the commands, we need to convert a Unix time stamp to a date/time string and/or vice versa. Here are the relevant commands using the date(1) command line utility on FreeBSD or macOS.
The actual date/time, printed into a kind of the ISO format:
The actual date/time, output as a Unix time stamp:
Conversion of a Unix time stamp into a kind of the ISO format:
Conversion of a date/time string to the Unix time stamp:
In all commands, use the
Copyright © Dr. Rolf Jansen - 2018-06-12 03:32:28