|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Nonmember functions | ||||
| Helper classes | ||||
(C++26) |
Defined in header <chrono> | ||
class weekday; | (since C++20) | |
inlineconstexpr std::chrono::weekday Sunday{0}; | (since C++20) | |
inlineconstexpr std::chrono::weekday Monday{1}; | (since C++20) | |
inlineconstexpr std::chrono::weekday Tuesday{2}; | (since C++20) | |
inlineconstexpr std::chrono::weekday Wednesday{3}; | (since C++20) | |
inlineconstexpr std::chrono::weekday Thursday{4}; | (since C++20) | |
inlineconstexpr std::chrono::weekday Friday{5}; | (since C++20) | |
inlineconstexpr std::chrono::weekday Saturday{6}; | (since C++20) | |
The classweekday represent a day of the week in theproleptic Gregorian calendar. Its normal range is[0, 6], for Sunday through Saturday, but it can hold any value in the range[0, 255]. Seven named constants are predefined in thestd::chrono namespace for the seven days of the week.
weekday is aTriviallyCopyableStandardLayoutType.
Contents |
constructs aweekday(public member function)[edit] | |
| increments or decrements the weekday (public member function)[edit] | |
| adds or subtracts a number of days (public member function)[edit] | |
| retrieves the stored weekday value retrieves ISO 8601 weekday value (public member function)[edit] | |
| checks if the stored weekday value is valid (public member function)[edit] | |
convenience syntax for constructing aweekday_indexed orweekday_last from thisweekday(public member function)[edit] |
(C++20) | compares twoweekday values(function)[edit] |
(C++20) | performs arithmetic onweekdays(function)[edit] |
(C++20) | outputs aweekday into a stream(function template)[edit] |
(C++20) | parses aweekday from a stream according to the provided format(function template)[edit] |
formatting support forweekday(class template specialization)[edit] | |
| hash support forstd::chrono::weekday (class template specialization) |
Output:
WedThuFri
(C++20) | represents the nthweekday of a month (class)[edit] |