Given a Unixtime such as 1551996855 (Thu, 07 Mar 2019 22:14:15 +0000), how can convert and extract just HH:MM, (22:14)?
Asked
Active
Viewed 184 times
1 Answers
0
you could use date
for the conversion and specify +%H:%M
as the format:
date -d @$"1551996855" +%H:%M
- note: the option to use with
date
will be different than-d
if you are not on a Linux system (which usesdate
from GNU coreutils).. so YMMV

Corey Goldberg
- 59,062
- 28
- 129
- 143