Format | Interpreted as |
---|---|
%% | literal percent sign (%) |
%A | weekday name (e.g. Sunday) |
%a | weekday name in short fomat (e.g. Sun) |
%B | full month name (e.g. January) |
%b | month name (e.g. Jan) |
%H | hour (00..23) |
%I | hour (01..12) |
%j | day of year (001..366) |
%k | hour ( 0..23) |
%l | hour ( 1..12) |
%M | minute (00..59) |
%m | month (01..12) |
%p | Define AM or PM; blank if not known |
%R | 24-hour hour and minute; same as %H:%M |
%r | 12-hour clock time (e.g. 11:11:04 PM) |
%S | second (00..60) |
%s | Unix epoch: seconds since 1970-01-01 00:00:00 UTC (not available in older UNIXes) |
%T | time, equivalent to %H:%M:%S |
%Z | time zone name (e.g. PDT) |
%z | time zone offset (direction, hours, minutes, e.g. -0700) |
Below are a few useful links for the date
command in Unix shells:
%s
, seconds since 1970)