0

Given a Unixtime such as 1551996855 (Thu, 07 Mar 2019 22:14:15 +0000), how can convert and extract just HH:MM, (22:14)?

1 Answers1

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 uses date from GNU coreutils).. so YMMV
Corey Goldberg
  • 59,062
  • 28
  • 129
  • 143