40#ifndef QSC_TIMESTAMP_H
41#define QSC_TIMESTAMP_H
46QSC_CPLUSPLUS_ENABLED_START
99#define QSC_TIMESTAMP_EPOCH_START 1900ULL
105#define QSC_TIMESTAMP_SECONDS_PER_MINUTE 60ULL
111#define QSC_TIMESTAMP_SECONDS_PER_HOUR (QSC_TIMESTAMP_SECONDS_PER_MINUTE * 60ULL)
117#define QSC_TIMESTAMP_SECONDS_PER_DAY (QSC_TIMESTAMP_SECONDS_PER_HOUR * 24ULL)
123#define QSC_TIMESTAMP_STRING_SIZE 20ULL
207#if defined(QSC_DEBUG_MODE)
214QSC_CPLUSPLUS_ENABLED_END
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition common.h:520
QSC_EXPORT_API uint64_t qsc_timestamp_datetime_to_seconds(const char input[QSC_TIMESTAMP_STRING_SIZE])
Convert the date-time string to a seconds from epoch unsigned 64-bit integer.
Definition timestamp.c:282
QSC_EXPORT_API uint64_t qsc_timestamp_epochtime_seconds(void)
Get the date and time from the current locale in seconds from epoch.
Definition timestamp.c:362
QSC_EXPORT_API uint64_t qsc_timestamp_datetime_seconds_remaining(const char basetime[QSC_TIMESTAMP_STRING_SIZE], const char comptime[QSC_TIMESTAMP_STRING_SIZE])
Compare a base date-time with another future date-time string, and return the difference in seconds....
Definition timestamp.c:253
QSC_EXPORT_API void qsc_timestamp_time_struct_to_string(char output[QSC_TIMESTAMP_STRING_SIZE], const struct tm *tstruct)
Convert a time structure to a date and time string. Time-stamp string format is YYYY-MM-DD HH-MM-SS.
Definition timestamp.c:9
QSC_EXPORT_API void qsc_timestamp_current_datetime(char output[QSC_TIMESTAMP_STRING_SIZE])
Get the calendar date and time from the current locale. Time-stamp string format is YYYY-MM-DD HH-MM-...
Definition timestamp.c:173
#define QSC_TIMESTAMP_STRING_SIZE
The size of the time-stamp string.
Definition timestamp.h:123
QSC_EXPORT_API void qsc_timestamp_current_time(char output[QSC_TIMESTAMP_STRING_SIZE])
Get the local time.
Definition timestamp.c:206
QSC_EXPORT_API void qsc_timestamp_current_date(char output[QSC_TIMESTAMP_STRING_SIZE])
Get the calendar date from the current locale.
Definition timestamp.c:126
QSC_EXPORT_API void qsc_timestamp_string_to_time_struct(struct tm *tstruct, const char input[QSC_TIMESTAMP_STRING_SIZE])
Convert a date and time string to a time structure. Time-stamp string format must be YYYY-MM-DD HH-MM...
Definition timestamp.c:100
QSC_EXPORT_API uint64_t qsc_timestamp_datetime_utc(void)
Get the calendar date and time for utc time.
Definition timestamp.c:298
QSC_EXPORT_API void qsc_timestamp_seconds_to_datetime(uint64_t tsec, char output[QSC_TIMESTAMP_STRING_SIZE])
Convert a seconds count from epoch-time to a date-time string.
Definition timestamp.c:330