date
Here are a few examples. Also see the documentation for the `-d' option in the previous section.
date --date='2 days ago'
date --date='3 months 1 day'
date --date='25 Dec' +%j
date '+%B %d'But this may not be what you want because for the first nine days of the month, the `%d' expands to a zero-padded two-digit field, for example `date -d 1may '+%B %d'' will print `May 01'.
-
modifier to suppress
the padding altogether.
date -d=1may '+%B %-d'
date
when setting the system clock:
date +%m%d%H%M%Y.%S
date --set='+2 minutes'
Mon, 25 Mar 1996 23:34:17 -0600
Go to the first, previous, next, last section, table of contents.