|
Botan 3.13.0
Crypto and TLS for C&
|
#include <calendar.h>
Public Member Functions | |
| calendar_point (const std::chrono::system_clock::time_point &time_point) | |
| calendar_point (uint32_t y, uint32_t mon, uint32_t d, uint32_t h, uint32_t min, uint32_t sec) | |
| uint32_t | day () const |
| uint32_t | hour () const |
| uint32_t | minutes () const |
| uint32_t | month () const |
| uint32_t | seconds () const |
| int64_t | seconds_since_epoch () const |
| std::chrono::system_clock::time_point | to_std_timepoint () const |
| uint32_t | year () const |
Struct representing a particular date and time
Definition at line 20 of file calendar.h.
| Botan::calendar_point::calendar_point | ( | uint32_t | y, |
| uint32_t | mon, | ||
| uint32_t | d, | ||
| uint32_t | h, | ||
| uint32_t | min, | ||
| uint32_t | sec ) |
Initialize a calendar_point
| y | the year |
| mon | the month |
| d | the day |
| h | the hour |
| min | the minute |
| sec | the second |
Definition at line 83 of file calendar.cpp.
References BOTAN_ARG_CHECK.
|
explicit |
Convert a time_point to a calendar_point
| time_point | a time point from the system clock |
Definition at line 128 of file calendar.cpp.
References BOTAN_ARG_CHECK, day(), hour(), month(), and year().
|
inline |
The day of the month, 1 through 31
Definition at line 29 of file calendar.h.
Referenced by calendar_point(), Botan::ASN1_Time::from_time_point(), and seconds_since_epoch().
|
inline |
Hour in 24-hour form, 0 to 23
Definition at line 32 of file calendar.h.
Referenced by calendar_point(), Botan::ASN1_Time::from_time_point(), and seconds_since_epoch().
|
inline |
Minutes in the hour, 0 to 59
Definition at line 35 of file calendar.h.
Referenced by Botan::ASN1_Time::from_time_point(), and seconds_since_epoch().
|
inline |
The month, 1 through 12 for Jan to Dec
Definition at line 26 of file calendar.h.
Referenced by calendar_point(), Botan::ASN1_Time::from_time_point(), and seconds_since_epoch().
|
inline |
Seconds in the minute, 0 to 59
Definition at line 38 of file calendar.h.
Referenced by Botan::ASN1_Time::from_time_point(), and seconds_since_epoch().
| int64_t Botan::calendar_point::seconds_since_epoch | ( | ) | const |
Return seconds since epoch
This is negative for dates before 1970
Definition at line 98 of file calendar.cpp.
References day(), hour(), minutes(), month(), seconds(), and year().
Referenced by Botan::ASN1_Time::time_since_epoch(), and to_std_timepoint().
| std::chrono::system_clock::time_point Botan::calendar_point::to_std_timepoint | ( | ) | const |
Returns an STL timepoint object
Note this throws an exception if the time is not representable in the system time_t
Definition at line 102 of file calendar.cpp.
References seconds_since_epoch().
Referenced by Botan::ASN1_Time::to_std_timepoint().
|
inline |
The year, less than or equal to 9999
Definition at line 23 of file calendar.h.
Referenced by calendar_point(), Botan::ASN1_Time::from_time_point(), and seconds_since_epoch().