From d59751f0f0fea3725658b357272cbbfbd6e2f26e Mon Sep 17 00:00:00 2001 From: Lindsay Roberts Date: Sat, 2 May 2020 16:58:23 +0300 Subject: [PATCH] Update date formatting example to use threadsafe localtime --- doc/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api.rst b/doc/api.rst index 35f695c5..8da96d04 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -408,7 +408,7 @@ formatting:: std::time_t t = std::time(nullptr); // Prints "The date is 2016-04-29." (with the current date) - fmt::print("The date is {:%Y-%m-%d}.", *std::localtime(&t)); + fmt::print("The date is {:%Y-%m-%d}.", fmt::localtime(t)); The format string syntax is described in the documentation of `strftime `_.