From 0506b328b5342b643a1b761f11b38c50a8b99909 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 7 Nov 2020 09:59:57 -0800 Subject: [PATCH] Document chrono --- doc/api.rst | 10 +++++----- doc/syntax.rst | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 67fad039..ecaa6ef0 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -421,15 +421,15 @@ For example:: fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s); } -prints:: +prints: - Default format: 42s 100ms - strftime-like format: 03:15:30 +.. code:: none + + Default format: 42s 100ms + strftime-like format: 03:15:30 Chrono format specifications are described in :ref:`chrono-specs`. -.. doxygenclass:: formatter, Char> - .. _compile-api: Format string compilation diff --git a/doc/syntax.rst b/doc/syntax.rst index 8557dd4b..979ca101 100644 --- a/doc/syntax.rst +++ b/doc/syntax.rst @@ -319,13 +319,15 @@ Format specifications for chrono types have the following syntax: chrono_type: "a" | "A" | "b" | "B" | "c" | "C" | "d" | "D" | "e" | "F" | : "g" | "G" | "h" | "H" | "I" | "j" | "m" | "M" | "n" | "p" | : "q" | "Q" | "r" | "R" | "S" | "t" | "T" | "u" | "U" | "V" | - : "w" | "W" | "x" | "X" | "y" | "Y" | "z" | "Z" | "%" | + : "w" | "W" | "x" | "X" | "y" | "Y" | "z" | "Z" | "%" Literal chars are copied unchanged to the output. Precision is valid only for ``std::chrono::duration`` types with a floating-point representation type. *conversion_spec* are conversion specifiers documented in `strftime -`_. +`_. Specifiers that have a +calendaric component such as `'d'` are valid only for ``std::tm`` and not +durations or time points. .. _formatexamples: