From e38428b934d92ebf3a0f9584e4d6a2ee749629f7 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 22 Dec 2022 00:17:27 +0100 Subject: [PATCH] doc: adjust chrono_format_spec documentation to match library behavior References: #3237 --- doc/syntax.rst | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/syntax.rst b/doc/syntax.rst index 74b64c5a..a3d66d34 100644 --- a/doc/syntax.rst +++ b/doc/syntax.rst @@ -304,11 +304,11 @@ The available presentation types for pointers are: Chrono Format Specifications ============================ -Format specifications for chrono duration and time point types as well as -``std::tm`` have the following syntax: +Format specifications for chrono time points as well as ``std::tm`` have the +following syntax: .. productionlist:: sf - chrono_format_spec: [[`fill`]`align`][`width`]["." `precision`][`chrono_specs`] + chrono_format_spec: [`chrono_specs`] chrono_specs: [`chrono_specs`] `conversion_spec` | `chrono_specs` `literal_char` conversion_spec: "%" [`modifier`] `chrono_type` literal_char: @@ -318,8 +318,14 @@ Format specifications for chrono duration and time point types as well as : "q" | "Q" | "r" | "R" | "S" | "t" | "T" | "u" | "U" | "V" | : "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. +Literal chars are copied unchanged to the output. For durations, the syntax is: + +.. productionlist:: sf + chrono_format_spec: [[`fill`]`align`][`width`]["." `precision`][`chrono_specs`] + chrono_specs: [`chrono_specs`] `literal_char` + +Precision is valid only for ``std::chrono::duration`` types with a +floating-point representation type. The available presentation types (*chrono_type*) are: