[time.cal.operators]

# 30 Time library [[time]](./#time)

## 30.8 The civil calendar [[time.cal]](time.cal#operators)

### 30.8.18 Conventional syntax operators [time.cal.operators]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7904)

A set of overloaded operator/ functions provides
a conventional syntax for the creation of civil calendar dates[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7908)

[*Note [1](#note-1)*:

The year, month, and day are accepted in any of the following 3 orders:*year*/*month*/*day**month*/*day*/*year**day*/*month*/*year*

Anywhere a *day* is needed, any of the following can also be specified:last*weekday*[*i*]*weekday*[last]

â *end note*]

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7925)

[*Note [2](#note-2)*:

Partial-date types such as year_month and month_day can be created by not applying the second division operator
for any of the three orders[.](#3.sentence-1)

For example:year_month ym = 2015y/April;
month_day md1 = April/4;
month_day md2 = 4d/April;

â *end note*]

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7937)

[*Example [1](#example-1)*: auto a = 2015/4/4; // a == int(125)auto b = 2015y/4/4; // b == year_month_day{year(2015), month(4), day(4)}auto c = 2015y/4d/April; // error: no viable operator/ for first /auto d = 2015/April/4; // error: no viable operator/ for first / â *end example*]

[ð](#itemdecl:1)

`constexpr year_month
  operator/(const year& y, const month& m) noexcept;
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7953)

*Returns*: {y, m}[.](#5.sentence-1)

[ð](#itemdecl:2)

`constexpr year_month
  operator/(const year& y, int   m) noexcept;
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7964)

*Returns*: y / month(m)[.](#6.sentence-1)

[ð](#itemdecl:3)

`constexpr month_day
  operator/(const month& m, const day& d) noexcept;
`

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7975)

*Returns*: {m, d}[.](#7.sentence-1)

[ð](#itemdecl:4)

`constexpr month_day
  operator/(const month& m, int d) noexcept;
`

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7986)

*Returns*: m / day(d)[.](#8.sentence-1)

[ð](#itemdecl:5)

`constexpr month_day
  operator/(int m, const day& d) noexcept;
`

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L7997)

*Returns*: month(m) / d[.](#9.sentence-1)

[ð](#itemdecl:6)

`constexpr month_day
  operator/(const day& d, const month& m) noexcept;
`

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8008)

*Returns*: m / d[.](#10.sentence-1)

[ð](#itemdecl:7)

`constexpr month_day
  operator/(const day& d, int m) noexcept;
`

[11](#11)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8019)

*Returns*: month(m) / d[.](#11.sentence-1)

[ð](#itemdecl:8)

`constexpr month_day_last
  operator/(const month& m, last_spec) noexcept;
`

[12](#12)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8030)

*Returns*: month_day_last{m}[.](#12.sentence-1)

[ð](#itemdecl:9)

`constexpr month_day_last
  operator/(int m, last_spec) noexcept;
`

[13](#13)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8041)

*Returns*: month(m) / last[.](#13.sentence-1)

[ð](#itemdecl:10)

`constexpr month_day_last
  operator/(last_spec, const month& m) noexcept;
`

[14](#14)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8052)

*Returns*: m / last[.](#14.sentence-1)

[ð](#itemdecl:11)

`constexpr month_day_last
  operator/(last_spec, int m) noexcept;
`

[15](#15)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8063)

*Returns*: month(m) / last[.](#15.sentence-1)

[ð](#itemdecl:12)

`constexpr month_weekday
  operator/(const month& m, const weekday_indexed& wdi) noexcept;
`

[16](#16)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8074)

*Returns*: {m, wdi}[.](#16.sentence-1)

[ð](#itemdecl:13)

`constexpr month_weekday
  operator/(int m, const weekday_indexed& wdi) noexcept;
`

[17](#17)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8085)

*Returns*: month(m) / wdi[.](#17.sentence-1)

[ð](#itemdecl:14)

`constexpr month_weekday
  operator/(const weekday_indexed& wdi, const month& m) noexcept;
`

[18](#18)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8096)

*Returns*: m / wdi[.](#18.sentence-1)

[ð](#itemdecl:15)

`constexpr month_weekday
  operator/(const weekday_indexed& wdi, int m) noexcept;
`

[19](#19)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8107)

*Returns*: month(m) / wdi[.](#19.sentence-1)

[ð](#itemdecl:16)

`constexpr month_weekday_last
  operator/(const month& m, const weekday_last& wdl) noexcept;
`

[20](#20)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8118)

*Returns*: {m, wdl}[.](#20.sentence-1)

[ð](#itemdecl:17)

`constexpr month_weekday_last
  operator/(int m, const weekday_last& wdl) noexcept;
`

[21](#21)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8129)

*Returns*: month(m) / wdl[.](#21.sentence-1)

[ð](#itemdecl:18)

`constexpr month_weekday_last
  operator/(const weekday_last& wdl, const month& m) noexcept;
`

[22](#22)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8140)

*Returns*: m / wdl[.](#22.sentence-1)

[ð](#itemdecl:19)

`constexpr month_weekday_last
  operator/(const weekday_last& wdl, int m) noexcept;
`

[23](#23)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8151)

*Returns*: month(m) / wdl[.](#23.sentence-1)

[ð](#itemdecl:20)

`constexpr year_month_day
  operator/(const year_month& ym, const day& d) noexcept;
`

[24](#24)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8162)

*Returns*: {ym.year(), ym.month(), d}[.](#24.sentence-1)

[ð](#itemdecl:21)

`constexpr year_month_day
  operator/(const year_month& ym, int d) noexcept;
`

[25](#25)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8173)

*Returns*: ym / day(d)[.](#25.sentence-1)

[ð](#itemdecl:22)

`constexpr year_month_day
  operator/(const year& y, const month_day& md) noexcept;
`

[26](#26)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8184)

*Returns*: y / md.month() / md.day()[.](#26.sentence-1)

[ð](#itemdecl:23)

`constexpr year_month_day
  operator/(int y, const month_day& md) noexcept;
`

[27](#27)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8195)

*Returns*: year(y) / md[.](#27.sentence-1)

[ð](#itemdecl:24)

`constexpr year_month_day
  operator/(const month_day& md, const year& y) noexcept;
`

[28](#28)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8206)

*Returns*: y / md[.](#28.sentence-1)

[ð](#itemdecl:25)

`constexpr year_month_day
  operator/(const month_day& md, int y) noexcept;
`

[29](#29)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8217)

*Returns*: year(y) / md[.](#29.sentence-1)

[ð](#itemdecl:26)

`constexpr year_month_day_last
  operator/(const year_month& ym, last_spec) noexcept;
`

[30](#30)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8228)

*Returns*: {ym.year(), month_day_last{ym.month()}}[.](#30.sentence-1)

[ð](#itemdecl:27)

`constexpr year_month_day_last
  operator/(const year& y, const month_day_last& mdl) noexcept;
`

[31](#31)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8239)

*Returns*: {y, mdl}[.](#31.sentence-1)

[ð](#itemdecl:28)

`constexpr year_month_day_last
  operator/(int y, const month_day_last& mdl) noexcept;
`

[32](#32)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8250)

*Returns*: year(y) / mdl[.](#32.sentence-1)

[ð](#itemdecl:29)

`constexpr year_month_day_last
  operator/(const month_day_last& mdl, const year& y) noexcept;
`

[33](#33)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8261)

*Returns*: y / mdl[.](#33.sentence-1)

[ð](#itemdecl:30)

`constexpr year_month_day_last
  operator/(const month_day_last& mdl, int y) noexcept;
`

[34](#34)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8272)

*Returns*: year(y) / mdl[.](#34.sentence-1)

[ð](#itemdecl:31)

`constexpr year_month_weekday
  operator/(const year_month& ym, const weekday_indexed& wdi) noexcept;
`

[35](#35)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8283)

*Returns*: {ym.year(), ym.month(), wdi}[.](#35.sentence-1)

[ð](#itemdecl:32)

`constexpr year_month_weekday
  operator/(const year& y, const month_weekday& mwd) noexcept;
`

[36](#36)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8294)

*Returns*: {y, mwd.month(), mwd.weekday_indexed()}[.](#36.sentence-1)

[ð](#itemdecl:33)

`constexpr year_month_weekday
  operator/(int y, const month_weekday& mwd) noexcept;
`

[37](#37)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8305)

*Returns*: year(y) / mwd[.](#37.sentence-1)

[ð](#itemdecl:34)

`constexpr year_month_weekday
  operator/(const month_weekday& mwd, const year& y) noexcept;
`

[38](#38)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8316)

*Returns*: y / mwd[.](#38.sentence-1)

[ð](#itemdecl:35)

`constexpr year_month_weekday
  operator/(const month_weekday& mwd, int y) noexcept;
`

[39](#39)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8327)

*Returns*: year(y) / mwd[.](#39.sentence-1)

[ð](#itemdecl:36)

`constexpr year_month_weekday_last
  operator/(const year_month& ym, const weekday_last& wdl) noexcept;
`

[40](#40)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8338)

*Returns*: {ym.year(), ym.month(), wdl}[.](#40.sentence-1)

[ð](#itemdecl:37)

`constexpr year_month_weekday_last
  operator/(const year& y, const month_weekday_last& mwdl) noexcept;
`

[41](#41)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8349)

*Returns*: {y, mwdl.month(), mwdl.weekday_last()}[.](#41.sentence-1)

[ð](#itemdecl:38)

`constexpr year_month_weekday_last
  operator/(int y, const month_weekday_last& mwdl) noexcept;
`

[42](#42)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8360)

*Returns*: year(y) / mwdl[.](#42.sentence-1)

[ð](#itemdecl:39)

`constexpr year_month_weekday_last
  operator/(const month_weekday_last& mwdl, const year& y) noexcept;
`

[43](#43)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8371)

*Returns*: y / mwdl[.](#43.sentence-1)

[ð](#itemdecl:40)

`constexpr year_month_weekday_last
  operator/(const month_weekday_last& mwdl, int y) noexcept;
`

[44](#44)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8382)

*Returns*: year(y) / mwdl[.](#44.sentence-1)
