std::chrono::weekday

From cppreference.com
< cpp‎ | chrono
 
 
 
Date and time utilities
(C++11)
(C++11)
Clocks
(C++20)
                                                  
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Calendars
(C++20)
(C++20)
(C++20)
weekday
(C++20)
(C++20)
Time zones
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
C-style date and time
 
 
Defined in header <chrono>
class weekday;
(since C++20)
inline constexpr std::chrono::weekday Sunday{0};
(since C++20)
inline constexpr std::chrono::weekday Monday{1};
(since C++20)
inline constexpr std::chrono::weekday Tuesday{2};
(since C++20)
inline constexpr std::chrono::weekday Wednesday{3};
(since C++20)
inline constexpr std::chrono::weekday Thursday{4};
(since C++20)
inline constexpr std::chrono::weekday Friday{5};
(since C++20)
inline constexpr std::chrono::weekday Saturday{6};
(since C++20)

The class weekday represent a day of the week in the 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 the std::chrono namespace for the seven days of the week.

weekday is a TriviallyCopyable StandardLayoutType.

Member functions

constructs a weekday
(public member function)
increments or decrements the weekday
(public member function)
adds or subtracts a number of days
(public member function)
retrieves the stored weekday value
(public member function)
checks if the stored weekday value is valid
(public member function)
convenience syntax for constructing a weekday_indexed or weekday_last from this weekday
(public member function)

Nonmember functions

compares two weekday objects
(function)
performs arithmetic on weekdays
(function)
outputs a weekday into a stream
(function template)
outputs a weekday into a stream according to the provided format
(function template)
parses a weekday from a stream according to the provided format
(function template)