unix:date

Date and Time

GNU:

date -d "@$TIMESTAMP"

UNIX/macOS:

date -r "$TIMESTAMP"

strftime:

echo "$TIMESTAMP" | gawk '{print strftime("%c", $0)}'

date +%FT%T%z

ls /usr/share/zoneinfo/Asia
TZ='Asia/Tokyo' date

date -r 1420888742 # BSD date
date -d @1420888742 # GNU date

date -d '2021-02-19 23:42UTC'

specifying date and timezone:

date -u -d "2021-02-19 23:42 CET" +"%Y-%m-%d %H:%M %Z"

using current system time:

date -u +"%Y-%m-%d %H:%M %Z"
  • unix/date.txt
  • Last modified: 2021-07-15T07:52:10+0200
  • by Wolfgang