Namespaces
Variants
Views
Actions

std::chrono::month

From cppreference.com
< cpp‎ | chrono
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
 
 
Defined in header <chrono>
class month;
(since C++20)
inline constexpr std::chrono::month January{1};
(since C++20)
inline constexpr std::chrono::month February{2};
(since C++20)
inline constexpr std::chrono::month March{3};
(since C++20)
inline constexpr std::chrono::month April{4};
(since C++20)
inline constexpr std::chrono::month May{5};
(since C++20)
inline constexpr std::chrono::month June{6};
(since C++20)
inline constexpr std::chrono::month July{7};
(since C++20)
inline constexpr std::chrono::month August{8};
(since C++20)
inline constexpr std::chrono::month September{9};
(since C++20)
inline constexpr std::chrono::month October{10};
(since C++20)
inline constexpr std::chrono::month November{11};
(since C++20)
inline constexpr std::chrono::month December{12};
(since C++20)

The class month represents a month in a year. Its normal range is [112], but it may hold any number in [0255]. Twelve named constants are predefined in the std::chrono namespace for the twelve months of the year.

month is a TriviallyCopyable StandardLayoutType.

[edit] Member functions

constructs a month
(public member function) [edit]
increments or decrements the month
(public member function) [edit]
adds or subtracts a number of months
(public member function) [edit]
retrieves the stored month value
(public member function) [edit]
checks if the stored month value is in the normal range
(public member function) [edit]

[edit] Nonmember functions

compares two month values
(function) [edit]
performs arithmetic on months
(function) [edit]
outputs a month into a stream
(function template) [edit]
parses a month from a stream according to the provided format
(function template) [edit]

[edit] Helper classes

formatting support for month
(class template specialization) [edit]
hash support for std::chrono::month
(class template specialization)