From 2c5d1283b05c127230338d3f81e45c002a00ecc8 Mon Sep 17 00:00:00 2001 From: HowardHinnant Date: Sat, 1 Aug 2015 21:04:11 -0400 Subject: [PATCH] Updated Examples and Recipes (markdown) --- Examples-and-Recipes.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Examples-and-Recipes.md b/Examples-and-Recipes.md index 14798f9..ba3b2b3 100644 --- a/Examples-and-Recipes.md +++ b/Examples-and-Recipes.md @@ -127,6 +127,26 @@ And the conversion from `day_point` back to `year_month_day` calls this algorith http://howardhinnant.github.io/date_algorithms.html#civil_from_days +Example: + + int + main() + { + using namespace date; + auto ymd = 2015_y/55/250; + std::cout << ymd << '\n'; + ymd += months{0}; + std::cout << ymd << '\n'; + ymd = day_point(ymd); + std::cout << ymd << '\n'; + } + +Outputs: + + 2015-55-94 + 2019-07-94 + 2019-10-02 + The specifications for these functions do not yet guarantee this "normalization behavior." But the implementations has been thoroughly tested for this behavior and the specification will be updated soon. ***