Updated Examples and Recipes (markdown)

HowardHinnant
2015-08-01 20:54:23 -04:00
parent 4134a6731a
commit 8f1860b593

@@ -115,7 +115,7 @@ The following function will "normalize" a `year_month_day`, much like `mktime` n
return ymd; return ymd;
} }
The first line simply adds 0 months to the `ymd`. If `ymd.month()` is 0, with will subtract one from the `year` and set the month to `Dec`. If `ymd.month()` is greater than 12, the year will be incremented as many times as appropriate, and the month will be brought within the proper range. This operation will do nothing if `ymd.month().ok()` is already true. The first line simply adds 0 months to the `ymd`. If `ymd.month()` is 0, this will subtract one from the `year` and set the month to `Dec`. If `ymd.month()` is greater than 12, the year will be incremented as many times as appropriate, and the month will be brought within the proper range. This operation will do nothing if `ymd.month().ok()` is already true.
The second line will "normalize" the day field. The second line requires that the month field is already normalized. For example `2015_y/dec/32` will become `2016_y/jan/1`. If the day field is already in range, there will be no change. The second line will "normalize" the day field. The second line requires that the month field is already normalized. For example `2015_y/dec/32` will become `2016_y/jan/1`. If the day field is already in range, there will be no change.