52#ifndef QSC_TIMESTAMP_H
53#define QSC_TIMESTAMP_H
58QSC_CPLUSPLUS_ENABLED_START
111#define QSC_TIMESTAMP_EPOCH_START 1900ULL
117#define QSC_TIMESTAMP_SECONDS_PER_MINUTE 60U
123#define QSC_TIMESTAMP_SECONDS_PER_HOUR (QSC_TIMESTAMP_SECONDS_PER_MINUTE * 60U)
129#define QSC_TIMESTAMP_SECONDS_PER_DAY (QSC_TIMESTAMP_SECONDS_PER_HOUR * 24U)
135#define QSC_TIMESTAMP_STRING_SIZE 20U
233#if defined(QSC_DEBUG_MODE)
240QSC_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 qsccommon.h:605
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:339
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:438
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:297
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:12
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:197
#define QSC_TIMESTAMP_STRING_SIZE
The size of the time-stamp string.
Definition timestamp.h:135
QSC_EXPORT_API void qsc_timestamp_current_time(char output[QSC_TIMESTAMP_STRING_SIZE])
Get the local time.
Definition timestamp.c:240
QSC_EXPORT_API uint64_t qsc_timestamp_epochtime_microseconds(void)
Get the date and time from the current locale in microseconds from epoch.
Definition timestamp.c:471
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:140
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:107
QSC_EXPORT_API uint64_t qsc_timestamp_datetime_utc(void)
Get the calendar date and time for utc time.
Definition timestamp.c:362
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:397
QSC_EXPORT_API uint64_t qsc_timestamp_epochtime_milliseconds(void)
Get the date and time from the current locale in milliseconds from epoch.
Definition timestamp.c:452