diff --git a/doc/api.md b/doc/api.md index 252225b0..1660ad7f 100644 --- a/doc/api.md +++ b/doc/api.md @@ -473,9 +473,9 @@ chrono-format-specifications). #include int main() { - std::time_t t = std::time(nullptr); + auto now = std::chrono::system_clock::now(); - fmt::print("The date is {:%Y-%m-%d}.", fmt::localtime(t)); + fmt::print("The date is {:%Y-%m-%d}.\n", now); // Output: The date is 2020-11-07. // (with 2020-11-07 replaced by the current date) @@ -488,8 +488,6 @@ chrono-format-specifications). // Output: strftime-like format: 03:15:30 } -::: localtime(std::time_t) - ::: gmtime(std::time_t)