unix:date

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
unix:date [2020-11-10T14:16:10+0100]
Wolfgang [Convert time to UTC (GNU date)]
unix:date [2021-07-15T07:52:10+0200] (current)
Wolfgang
Line 1: Line 1:
 ====== Date and Time ====== ====== Date and Time ======
  
 +
 +
 +===== Convert UNIX Timestamp =====
 +
 +GNU:
 +<code>
 +date -d "@$TIMESTAMP"
 +</code>
 +
 +UNIX/macOS:
 +<code>
 +date -r "$TIMESTAMP"
 +</code>
 +
 +strftime:
 +<code>
 +echo "$TIMESTAMP" | gawk '{print strftime("%c", $0)}'
 +</code>
 +
 +===== ISO 8601 Timestamp =====
 <sxh bash> <sxh bash>
 date +%FT%T%z date +%FT%T%z
  • unix/date.1605014170.txt.gz
  • Last modified: 2020-11-10T14:16:10+0100
  • by Wolfgang