Namespaces
Variants
Actions

std::chrono::year

From cppreference.com
< cpp‎ | chrono
 
C++
 
Date and time library
Time point
(C++11)
(C++20)
Duration
(C++11)
Clocks
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Time of day
(C++20)(C++20)
(C++20)(C++20)
(C++20)
Calendar
(C++20)
(C++20)
year
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
chrono I/O
(C++20)

 
std::chrono::year
Defined in header <chrono>
class year;
(since C++20)

The class year represents a year in the proleptic Gregorian calendar. Its range is [-3276732767].

year is a TriviallyCopyable StandardLayoutType.

Contents

[edit] Member functions

constructs a year
(public member function) [edit]
increments or decrements the year
(public member function) [edit]
adds or subtracts a number of years from a year
(public member function) [edit]
applies unary operators to year
(public member function) [edit]
determines if the year is a leap year
(public member function) [edit]
retrieve the year value
(public member function) [edit]
checks if the stored year value is valid
(public member function) [edit]
[static]
returns the smallest possible year value
(public static member function) [edit]
[static]
returns the largest possible year
(public static member function) [edit]

[edit] Non-member functions

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

[edit] Helper classes

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

[edit] Literals

Defined in inline namespace std::literals::chrono_literals
a std::chrono::year literal representing a particular year
(function) [edit]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant