Working with date command
Quick reminder on how to use date command:
%a – Displays the locale’s abbreviated weekday name.
%A – Displays the locale’s full weekday name.
%b – Displays the locale’s abbreviated month name.
%B – Displays the locale’s full month name.
%c – Displays the locale’s appropriate date and time representation (default).
%C – Displays the first 2 digits of the four-digit year as a decimal number (00-99). A year is divided by 100 and truncated to an integer.
%d – Displays the day of the month as a decimal number (01-31). In a two-digit field, a 0 is used as leading space fill.
%D – Displays the date in the format equivalent to %m/%d/%y.
%e – Displays the day of the month as a decimal number (1-31). In a two-digit field, a blank space is used as leading space fill.
%h – Displays the locale’s abbreviated month name (a synonym for %b).
%H – Displays the hour (24-hour clock) as a decimal number (00-23).
%I – Displays the hour (12-hour clock) as a decimal number (01-12).
%j – Displays the day of year as a decimal number (001-366).
%k – Displays the 24-hour-clock hour clock as a right-align, space-filled number (0 – 23).
%m – Displays the month of year as a decimal number (01-12).
%M – Displays the minutes as a decimal number (00-59).
%p – Displays the locale’s equivalent of either AM or PM.
%r – Displays 12-hour clock time (01-12) using the AM-PM notation; in the POSIX locale, it is equivalent to %I:%M:%S %p.
%S – Displays the seconds as a decimal number (00 – 59).
%T – Displays the 24-hour clock (00-23) in the format equivalent to HH:MM:SS.
%w – Displays the weekday as a decimal number in the range 0-6 (Sunday = 0). Refer to the %u field descriptor.
Recent usage example
echo "=== $(hostname).$(date "+%d%b%Y") ==="