Sha256: 31693426461507ca805bf03164509a50a3dff53279eb40de943ca76a894c793c
Contents?: true
Size: 1.12 KB
Versions: 16
Compression:
Stored size: 1.12 KB
Contents
/** * @file * Declares utility functions for dealing with time. */ #pragma once #include <string> #include <ctime> namespace leatherman { namespace util { /** * Adds the specified expiry_minutes to the current time and returns * the related date time string in UTC format. * @return Returns an empty string in case it fails to allocate the buffer. */ std::string get_expiry_datetime(int expiry_minutes = 1); /** * Gets the current time in ISO8601 format * @param modifier_in_secords Offset from the current time in seconds * @return Returns the current time plus the modifier */ std::string get_ISO8601_time(unsigned int modifier_in_seconds = 0); /** @return Returns the current datetime string in the %Y%m%d_%H%M%S format */ std::string get_date_time(); /** * Turns a stored time into a local time with correction for timezones. * @param stored_time The time to be converted. * @param result The struct in which to store the local time. */ void get_local_time(std::time_t* stored_time, std::tm* result); }} // namespace leatherman::util
Version data entries
16 entries across 16 versions & 2 rubygems