-
Notifications
You must be signed in to change notification settings - Fork 0
calendar.h ~ calendar ~ milli_type
Baptiste Thémine edited this page Jul 9, 2020
·
3 revisions
namespace calendar::milli { typedef /* implementation defined */ milli_type; }
Defines integer type to store the representation of milliseconds in a second.
An ISO 8601 valid milli_type
must have a value between 0 and 999, in which case it can be safely handled as a milli
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 display seconds and milliseconds from a date.
#include <iostream>
#include <JLC/JLC.h>
using namespace JLC;
using namespace calendar::second;
using namespace calendar::milli;
int main(){
const Date date = Date(12345LL);
const second_type sec = date.second();
const milli_type milli = date.milli();
std::cout << date << std::endl;
std::cout << sec << "." << milli << std::endl;
}
0001-01-01T00:00:12.345+0000
12.345