-
Notifications
You must be signed in to change notification settings - Fork 0
calendar.h ~ calendar ~ year_type
Baptiste Thémine edited this page Jul 9, 2020
·
11 revisions
namespace calendar::year { typedef /* implementation defined */ year_type; }
Defines integer type to store the representation of Gregorian years.
An ISO 8601 valid year_type
must have a value between 1 and 292277025, in which case it can be safely handled as a year
parameter such as in datetime_type or class Date constructor, otherwise the program is ill-formed.
Name | Description |
---|---|
operator>> operator<< |
I/O stream operators for calendar types. |
In the following example, we create a valid date with the year specified by user input.
#include <iostream>
#include <JLC/JLC.h>
using namespace JLC;
using namespace calendar::year;
int main(){
year_type year;
do{
std::cout << "year = ";
std::cin >> year;
}while(!debug::verify(std::cin));
std::cout << Date(year) << std::endl;
}
year = test
year = 0
year = 2012
2012-01-01T00:00:00+0000