coreutils: Time conversion specifiers
1
1 21.1.1 Time conversion specifiers
1 ---------------------------------
1
1 ‘date’ conversion specifiers related to times.
1
1 ‘%H’
1 hour (‘00’...‘23’)
1 ‘%I’
1 hour (‘01’...‘12’)
1 ‘%k’
1 hour, space padded (‘ 0’...‘23’); equivalent to ‘%_H’. This is a
1 GNU extension.
1 ‘%l’
1 hour, space padded (‘ 1’...‘12’); equivalent to ‘%_I’. This is a
1 GNU extension.
1 ‘%M’
1 minute (‘00’...‘59’)
1 ‘%N’
1 nanoseconds (‘000000000’...‘999999999’). This is a GNU extension.
1 ‘%p’
1 locale’s equivalent of either ‘AM’ or ‘PM’; blank in many locales.
1 Noon is treated as ‘PM’ and midnight as ‘AM’.
1 ‘%P’
1 like ‘%p’, except lower case. This is a GNU extension.
1 ‘%r’
1 locale’s 12-hour clock time (e.g., ‘11:11:04 PM’)
1 ‘%R’
1 24-hour hour and minute. Same as ‘%H:%M’.
1 ‘%s’
1 seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC. Leap
1 seconds are not counted unless leap second support is available.
1 ⇒%s-examples, for examples. This is a GNU extension.
1 ‘%S’
1 second (‘00’...‘60’). This may be ‘60’ if leap seconds are
1 supported.
1 ‘%T’
1 24-hour hour, minute, and second. Same as ‘%H:%M:%S’.
1 ‘%X’
1 locale’s time representation (e.g., ‘23:13:48’)
1 ‘%z’
1 Four-digit numeric time zone, e.g., ‘-0600’ or ‘+0530’, or ‘-0000’
1 if no time zone is determinable. This value reflects the numeric
1 time zone appropriate for the current time, using the time zone
1 rules specified by the ‘TZ’ environment variable. A time zone is
1 not determinable if its numeric offset is zero and its abbreviation
1 begins with ‘-’. The time (and optionally, the time zone rules)
1 can be overridden by the ‘--date’ option.
1 ‘%:z’
1 Numeric time zone with ‘:’, e.g., ‘-06:00’ or ‘+05:30’), or
1 ‘-00:00’ if no time zone is determinable. This is a GNU extension.
1 ‘%::z’
1 Numeric time zone to the nearest second with ‘:’ (e.g., ‘-06:00:00’
1 or ‘+05:30:00’), or ‘-00:00:00’ if no time zone is determinable.
1 This is a GNU extension.
1 ‘%:::z’
1 Numeric time zone with ‘:’ using the minimum necessary precision
1 (e.g., ‘-06’, ‘+05:30’, or ‘-04:56:02’), or ‘-00’ if no time zone
1 is determinable. This is a GNU extension.
1 ‘%Z’
1 alphabetic time zone abbreviation (e.g., ‘EDT’), or nothing if no
1 time zone is determinable. See ‘%z’ for how it is determined.
1