aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/os.texi37
1 files changed, 27 insertions, 10 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 59c269a3084..0cb9de9f9a8 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1486,8 +1486,8 @@ This stands for the full name of the month.
1486@item %c 1486@item %c
1487This is a synonym for @samp{%x %X}. 1487This is a synonym for @samp{%x %X}.
1488@item %C 1488@item %C
1489This has a locale-specific meaning. In the default locale (named C), it 1489This stands for the century, that is, the year divided by 100,
1490is equivalent to @samp{%A, %B %e, %Y}. 1490truncated toward zero.
1491@item %d 1491@item %d
1492This stands for the day of month, zero-padded. 1492This stands for the day of month, zero-padded.
1493@item %D 1493@item %D
@@ -1530,8 +1530,11 @@ This stands for the calendar quarter (1--4).
1530This is a synonym for @samp{%I:%M:%S %p}. 1530This is a synonym for @samp{%I:%M:%S %p}.
1531@item %R 1531@item %R
1532This is a synonym for @samp{%H:%M}. 1532This is a synonym for @samp{%H:%M}.
1533@item %s
1534This stands for the integer number of seconds since the epoch.
1533@item %S 1535@item %S
1534This stands for the seconds (00--59). 1536This stands for the second (00--59, or 00--60 on platforms
1537that support leap seconds).
1535@item %t 1538@item %t
1536This stands for a tab character. 1539This stands for a tab character.
1537@item %T 1540@item %T
@@ -1561,22 +1564,31 @@ This stands for the year with century.
1561@item %Z 1564@item %Z
1562This stands for the time zone abbreviation (e.g., @samp{EST}). 1565This stands for the time zone abbreviation (e.g., @samp{EST}).
1563@item %z 1566@item %z
1564This stands for the time zone numerical offset (e.g., @samp{-0500}). 1567This stands for the time zone numerical offset. The @samp{z} can be
1568preceded by one, two, or three colons; if plain @samp{%z} stands for
1569@samp{-0500}, then @samp{%:z} stands for @samp{-05:00}, @samp{%::z}
1570stands for @samp{-05:00:00}, and @samp{%:::z} is like @samp{%::z}
1571except it suppresses trailing instances of @samp{:00} so it stands for
1572@samp{-05} in the same example.
1573@item %%
1574This stands for a single @samp{%}.
1565@end table 1575@end table
1566 1576
1577One or more flag characters can appear immediately after the @samp{%}.
1578@samp{0} pads with zeros, @samp{_} pads with blanks, @samp{-}
1579suppresses padding, @samp{^} upper-cases letters, and @samp{#}
1580reverses the case of letters.
1581
1567You can also specify the field width and type of padding for any of 1582You can also specify the field width and type of padding for any of
1568these @samp{%}-sequences. This works as in @code{printf}: you write 1583these @samp{%}-sequences. This works as in @code{printf}: you write
1569the field width as digits in the middle of a @samp{%}-sequences. If you 1584the field width as digits in a @samp{%}-sequence, after any flags.
1570start the field width with @samp{0}, it means to pad with zeros. If you
1571start the field width with @samp{_}, it means to pad with spaces.
1572
1573For example, @samp{%S} specifies the number of seconds since the minute; 1585For example, @samp{%S} specifies the number of seconds since the minute;
1574@samp{%03S} means to pad this with zeros to 3 positions, @samp{%_3S} to 1586@samp{%03S} means to pad this with zeros to 3 positions, @samp{%_3S} to
1575pad with spaces to 3 positions. Plain @samp{%3S} pads with zeros, 1587pad with spaces to 3 positions. Plain @samp{%3S} pads with zeros,
1576because that is how @samp{%S} normally pads to two positions. 1588because that is how @samp{%S} normally pads to two positions.
1577 1589
1578The characters @samp{E} and @samp{O} act as modifiers when used between 1590The characters @samp{E} and @samp{O} act as modifiers when used after
1579@samp{%} and one of the letters in the table above. @samp{E} specifies 1591any flags and field widths in a @samp{%}-sequence. @samp{E} specifies
1580using the current locale's alternative version of the date and time. 1592using the current locale's alternative version of the date and time.
1581In a Japanese locale, for example, @code{%Ex} might yield a date format 1593In a Japanese locale, for example, @code{%Ex} might yield a date format
1582based on the Japanese Emperors' reigns. @samp{E} is allowed in 1594based on the Japanese Emperors' reigns. @samp{E} is allowed in
@@ -1587,6 +1599,11 @@ based on the Japanese Emperors' reigns. @samp{E} is allowed in
1587representation of numbers, instead of the ordinary decimal digits. This 1599representation of numbers, instead of the ordinary decimal digits. This
1588is allowed with most letters, all the ones that output numbers. 1600is allowed with most letters, all the ones that output numbers.
1589 1601
1602To help debug programs, unrecognized @samp{%}-sequences stand for
1603themselves and are output as-is. Programs should not rely on this
1604behavior, as future versions of Emacs may recognize new
1605@samp{%}-sequences as extensions.
1606
1590This function uses the C library function @code{strftime} 1607This function uses the C library function @code{strftime}
1591(@pxref{Formatting Calendar Time,,, libc, The GNU C Library Reference 1608(@pxref{Formatting Calendar Time,,, libc, The GNU C Library Reference
1592Manual}) to do most of the work. In order to communicate with that 1609Manual}) to do most of the work. In order to communicate with that