Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Thanks Howard - seems like an interesting design choice to optimise the chrono syntax for the average case rather than the specific case. Commented Jan 17, 2023 at 11:21
  • I would document it somewhat differently. Just like there are different containers (vector, list, etc), there are different date data structures. Each has strengths and weaknesses. You get to choose the data structure that is optimized for your heaviest use. year_month_day is good at year and month calendrical arithmetic. If you're doing a lot of that, stay with that data structure without converting to sys_days. And sys_days is good at chronological arithmetic (which includes days units), and is good at converting to/from date/times. And you can losslessly convert between the two. Commented Jan 17, 2023 at 13:32
  • Examples: github.com/HowardHinnant/date/wiki/Examples-and-Recipes FAQ: github.com/HowardHinnant/date/wiki/FAQ Commented Jan 17, 2023 at 13:33