Skip to content

Commit 9f6c12c

Browse files
committed
Remove deprecated localtime from docs
1 parent 2d0518b commit 9f6c12c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

doc/api.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,9 @@ chrono-format-specifications).
473473
#include <fmt/chrono.h>
474474
475475
int main() {
476-
std::time_t t = std::time(nullptr);
476+
auto now = std::chrono::system_clock::now();
477477
478-
fmt::print("The date is {:%Y-%m-%d}.", fmt::localtime(t));
478+
fmt::print("The date is {:%Y-%m-%d}.\n", now);
479479
// Output: The date is 2020-11-07.
480480
// (with 2020-11-07 replaced by the current date)
481481
@@ -488,8 +488,6 @@ chrono-format-specifications).
488488
// Output: strftime-like format: 03:15:30
489489
}
490490
491-
::: localtime(std::time_t)
492-
493491
::: gmtime(std::time_t)
494492
495493
<a id="std-api"></a>

0 commit comments

Comments
 (0)