Fun with date

From ConShell
Revision as of 14:04, 3 September 2015 by Delimiter (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The date(1) command is capable of many things.

Convert an epoch (unix time) into something a human can make sense of

date --date='@2147483647'

Print yesterday's date. Handy for monthly cronjobs scheduled on day 1 but need to get the date of the last day prior month

date --date='1 day ago'
Wed Sep  2 11:01:35 PDT 2015