mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-06 22:24:27 +02:00
Updated Examples and Recipes (markdown)
@@ -134,17 +134,17 @@ Example:
|
|||||||
{
|
{
|
||||||
using namespace date;
|
using namespace date;
|
||||||
auto ymd = 2015_y/55/250;
|
auto ymd = 2015_y/55/250;
|
||||||
std::cout << ymd << '\n';
|
std::cout << ymd << (ymd.ok() ? "\n" : " invalid date\n");
|
||||||
ymd += months{0};
|
ymd += months{0};
|
||||||
std::cout << ymd << '\n';
|
std::cout << ymd << (ymd.ok() ? "\n" : " invalid date\n");
|
||||||
ymd = day_point(ymd);
|
ymd = day_point(ymd);
|
||||||
std::cout << ymd << '\n';
|
std::cout << ymd << (ymd.ok() ? "\n" : " invalid date\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
Outputs:
|
Outputs:
|
||||||
|
|
||||||
2015-55-250
|
2015-55-250 invalid date
|
||||||
2019-07-250
|
2019-07-250 invalid date
|
||||||
2020-03-06
|
2020-03-06
|
||||||
|
|
||||||
The specifications for these functions do not yet guarantee this "normalization behavior." But the implementation has been thoroughly tested for this behavior and the specification will be updated soon.
|
The specifications for these functions do not yet guarantee this "normalization behavior." But the implementation has been thoroughly tested for this behavior and the specification will be updated soon.
|
||||||
|
Reference in New Issue
Block a user