Skip to content

calendar.h ~ calendar ~ minute_type

Baptiste Thémine edited this page Jul 9, 2020 · 3 revisions
namespace calendar::minute { typedef /* implementation defined */ minute_type; }

Description

Defines integer type to store the representation of minutes in an hour.

An ISO 8601 valid minute_type must have a value between 0 and 59, in which case it can be safely handled as a min parameter such as in datetime_type or class Date constructor, otherwise the program is ill-formed.

Member functions

Name Description
operator>>
operator<<
I/O stream operators for calendar types.

Examples

In the following example, we display today's time.

#include <iostream>
#include <JLC/JLC.h>
using namespace JLC;
using namespace calendar::hour;
using namespace calendar::minute;

int main(){
    const Date today = Date::now();
    const hour_type hour = today.hour();
    const minute_type min = today.minute();
    std::cout << today << std::endl;
    std::cout << hour << "h" << min << std::endl;
}
2020-03-27T11:29:19+0000
11h29

See also

Clone this wiki locally