Kea  2.1.7-git
time_utilities.h File Reference
#include <string>
#include <sys/types.h>
#include <stdint.h>
#include <exceptions/exceptions.h>
+ Include dependency graph for time_utilities.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  isc::util::InvalidTime
 A standard DNS (or ISC) module exception that is thrown if a time conversion function encounters bad input. More...
 

Namespaces

 isc
 Defines the logger used by the top-level component of kea-lfc.
 
 isc::util
 
 isc::util::detail
 

Functions

int64_t isc::util::detail::gettimeWrapper ()
 Return the current time in seconds. More...
 
DNSSEC time conversion functions.

These functions convert between times represented in seconds (in integer) since epoch and those in the textual form used in the RRSIG records.

For integers we provide both 32-bit and 64-bit versions. The RRSIG expiration and inception fields are both 32-bit unsigned integers, so 32-bit versions would be more useful for protocol operations. However, with 32-bit integers we need to take into account wrap-around points and compare values using the serial number arithmetic as specified in RFC4034, which would be more error prone. We therefore provide 64-bit versions, too.

The timezone is always UTC for these functions.

uint64_t isc::util::timeFromText64 (const std::string &time_txt)
 Convert textual DNSSEC time to integer, 64-bit version. More...
 
uint32_t isc::util::timeFromText32 (const std::string &time_txt)
 Convert textual DNSSEC time to integer, 32-bit version. More...
 
string isc::util::timeToText64 (uint64_t value)
 Convert integral DNSSEC time to textual form, 64-bit version. More...
 
string isc::util::timeToText32 (const uint32_t value)
 Convert integral DNSSEC time to textual form, 32-bit version. More...