Variable: time-stamp-format
time-stamp-format is a customizable variable defined in
time-stamp.el.gz.
Value
"%Y-%02m-%02d %02H:%02M:%02S %l"
Documentation
Format of the string inserted by M-x time-stamp (time-stamp).
This is a string, used verbatim except for character sequences beginning with %, as follows.
%:A weekday name: Monday %#A gives uppercase: MONDAY
%3a abbreviated weekday: Mon %#a gives uppercase: MON
%:B month name: January %#B gives uppercase: JANUARY
%3b abbreviated month: Jan %#b gives uppercase: JAN
%02d day of month
%02H 24-hour clock hour
%02I 12-hour clock hour
%02m month number
%02M minute
%#p am or pm %P gives uppercase: AM or PM
%02S seconds
%w day number of week, Sunday is 0
%02y 2-digit year %Y 4-digit year
%Z time zone name: EST %#Z gives lowercase: est
%5z time zone offset: -0500 (since Emacs 27; see note below)
Non-date items:
%% a literal percent character: %
%f file name without directory %F absolute file name
%l login name %L full name of logged-in user
%q unqualified host name %Q fully-qualified host name
%h mail host name
Decimal digits between the % and the type character specify the field width. Strings are truncated on the right. A leading zero in the field width zero-fills a number.
For example, to get the format used by the date command,
use "%3a %3b %2d %02H:%02M:%02S %Z %Y".
The values of non-numeric formatted items depend on the locale
setting recorded in system-time-locale and locale-coding-system.
The examples here are for the default (C) locale.
time-stamp-time-zone controls the time zone used.
The default padding of some formats has changed to be more compatible with format-time-string. To be compatible with older versions of Emacs, specify a padding width (as shown) or use the : modifier to request the transitional behavior (again, as shown).
The behavior of %5z is new in Emacs 27. If your files might be
edited by older versions of Emacs also, do not use this format yet.
This variable was added, or its default value changed, in Emacs 27.1.
Probably introduced at or before Emacs version 26.1.
Source Code
;; Defined in /usr/src/emacs/lisp/time-stamp.el.gz
(defcustom time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S %l"
"Format of the string inserted by \\[time-stamp].
This is a string, used verbatim except for character sequences beginning
with %, as follows.
%:A weekday name: `Monday' %#A gives uppercase: `MONDAY'
%3a abbreviated weekday: `Mon' %#a gives uppercase: `MON'
%:B month name: `January' %#B gives uppercase: `JANUARY'
%3b abbreviated month: `Jan' %#b gives uppercase: `JAN'
%02d day of month
%02H 24-hour clock hour
%02I 12-hour clock hour
%02m month number
%02M minute
%#p `am' or `pm' %P gives uppercase: `AM' or `PM'
%02S seconds
%w day number of week, Sunday is 0
%02y 2-digit year %Y 4-digit year
%Z time zone name: `EST' %#Z gives lowercase: `est'
%5z time zone offset: `-0500' (since Emacs 27; see note below)
Non-date items:
%% a literal percent character: `%'
%f file name without directory %F absolute file name
%l login name %L full name of logged-in user
%q unqualified host name %Q fully-qualified host name
%h mail host name
Decimal digits between the % and the type character specify the
field width. Strings are truncated on the right.
A leading zero in the field width zero-fills a number.
For example, to get the format used by the `date' command,
use \"%3a %3b %2d %02H:%02M:%02S %Z %Y\".
The values of non-numeric formatted items depend on the locale
setting recorded in `system-time-locale' and `locale-coding-system'.
The examples here are for the default (`C') locale.
`time-stamp-time-zone' controls the time zone used.
The default padding of some formats has changed to be more compatible
with format-time-string. To be compatible with older versions of Emacs,
specify a padding width (as shown) or use the : modifier to request the
transitional behavior (again, as shown).
The behavior of `%5z' is new in Emacs 27. If your files might be
edited by older versions of Emacs also, do not use this format yet."
:type 'string
:version "27.1")