CppCommon  1.0.4.1
C++ Common Library
time_time.cpp

Time example

#include "time/time.h"
#include <iostream>
void show(const CppCommon::Time& time)
{
std::cout << "Time.year() = " << time.year() << std::endl;
std::cout << "Time.month() = " << time.month() << std::endl;
std::cout << "Time.day() = " << time.day() << std::endl;
std::cout << "Time.hour() = " << time.hour() << std::endl;
std::cout << "Time.minute() = " << time.minute() << std::endl;
std::cout << "Time.second() = " << time.second() << std::endl;
std::cout << "Time.millisecond() = " << time.millisecond() << std::endl;
std::cout << "Time.microsecond() = " << time.microsecond() << std::endl;
std::cout << "Time.nanosecond() = " << time.nanosecond() << std::endl;
std::cout << std::endl;
}
int main(int argc, char** argv)
{
std::cout << "UTC time:" << std::endl;
std::cout << "Local time:" << std::endl;
std::cout << "Min time:" << std::endl;
std::cout << "Max time:" << std::endl;
show(CppCommon::UtcTime(CppCommon::Timestamp(0xFFFFFFFFFFFFFFFF)));
return 0;
}
Local time.
Definition: time.h:235
Time.
Definition: time.h:48
int month() const noexcept
Get month value (1-12)
Definition: time.h:138
int year() const noexcept
Get year value (1970-2038 for 32-bit or 1970-3000 for 64-bit)
Definition: time.h:136
int millisecond() const noexcept
Get millisecond value (0-999)
Definition: time.h:150
int day() const noexcept
Get day value (1-31)
Definition: time.h:142
int minute() const noexcept
Get minute value (0-59)
Definition: time.h:146
int second() const noexcept
Get second value (0-59)
Definition: time.h:148
int hour() const noexcept
Get hour value (0-23)
Definition: time.h:144
int microsecond() const noexcept
Get microsecond value (0-999)
Definition: time.h:152
int nanosecond() const noexcept
Get nanosecond value (0-999)
Definition: time.h:154
UTC time.
Definition: time.h:209
Time definition.