From 456ecef97a1bb1ba92b275a4efa08bb2bbf967c5 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 7 Jul 2017 21:46:41 -0400 Subject: [PATCH] Updated Examples and Recipes (markdown) --- Examples-and-Recipes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples-and-Recipes.md b/Examples-and-Recipes.md index aa8cd01..88b347d 100644 --- a/Examples-and-Recipes.md +++ b/Examples-and-Recipes.md @@ -108,12 +108,12 @@ Let's say you want to find out how many hours ahead Sydney is from LA (now). Fi 17:00:00.000000 -Because we did not specify otherwise, the default behavior is to give us the full precision of `system_clock::time_point`. If you would prefer other behavior (e.g. minutes precision), that is easily accomplished with just a little more work. `using` directives make the code a little more readable: +Because we did not specify otherwise, the default behavior is to give us the full precision of `system_clock::time_point`. If you would prefer other behavior (e.g. minutes precision), that is easily accomplished with just a little more work: ```c++ using namespace date; using namespace std::chrono; - std::cout << make_time(floor(sy.get_local_time() - la.get_local_time())) << '\n'; + std::cout << date::format("%H:%M\n", sy.get_local_time() - la.get_local_time()); ``` And now the output is: