std::chrono::weekday::c_encoding, std::chrono::weekday::iso_encoding
From cppreference.com
 
 
 
 
 
 C++ 
 Feature test macros (C++20)
 Concepts library (C++20)
 Metaprogramming library (C++11)
 Ranges library (C++20)
 Filesystem library (C++17)
 Concurrency support library (C++11)
 Execution control library (C++26)
Date and time library 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
(C++11)
(C++20)
  (C++20)
(C++11)
(C++11)
(C++11)
(C++20)
(C++20)
(C++20)
(C++11)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
  (C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
std::chrono::weekday 
 
 
 Member functions
weekday::c_encodingweekday::iso_encoding
 Nonmember functions
 Helper classes
(C++26)
constexpr unsigned c_encoding() const noexcept;
 (1) 
 (since C++20) 
constexpr unsigned iso_encoding() const noexcept;
 (2) 
 (since C++20) 
1) Returns the weekday value stored in *this.
2) Returns the weekday value stored in *this, except that Sunday (stored as 0) is interpreted as 7 according to ISO 8601.
[edit] Return value
1) The weekday value stored in *this.
2) c_encoding() == 0u ? 7u : c_encoding()
[edit] Example
Run this code
#include <chrono> #include <iostream> int main() { std::cout << "i: C: ISO: Weekday:\n"; for (unsigned i{0}; i != 8; ++i) { const std::chrono::weekday w{i}; std::cout << i << " " << w.c_encoding() << " " << w.iso_encoding() << " " << w << '\n'; } }
Output:
i: C: ISO: Weekday: 0 0 7 Sun 1 1 1 Mon 2 2 2 Tue 3 3 3 Wed 4 4 4 Thu 5 5 5 Fri 6 6 6 Sat 7 0 7 Sun