time-stamp-format

time-stamp-format is a variable defined in `time-stamp.el'.
Its value is
"%:y-%02m-%02d %02H:%02M:%02S %u"

  • This variable is safe as a file local variable if its value
    satisfies the predicate `stringp'.

Documentation:
Format of the string inserted by M-x time-stamp.
The value may be a string or a list. Lists are supported only for
backward compatibility; see variable `time-stamp-old-format-warn'.

A string is used verbatim except for character sequences beginning
with %, as follows. 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.

%:a weekday name: `Monday'. %#A gives uppercase: `MONDAY'
%3a abbreviated weekday: `Mon'. %3A gives uppercase: `MON'
%:b month name: `January'. %#B gives uppercase: `JANUARY'
%3b abbreviated month: `Jan'. %3B 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: `03' %:y 4-digit year: `2003'
%z time zone name: `est'. %Z gives uppercase: `EST'

Non-date items:
%% a literal percent character: `%'
%f file name without directory %F gives absolute pathname
%s system name
%u user's login name %U user's full name
%h mail host name

Decimal digits between the % and the type character specify the
field width. Strings are truncated on the right; years on the left.
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".

In the future these formats will be aligned more with `format-time-string'.
Because of this transition, the default padding for numeric formats will
change in a future version. Therefore either a padding width should be
specified, or the : modifier should be used to explicitly request the
historical default.

You can customize this variable.

This variable was introduced, or its default value was changed, in version 20.1 of Emacs.