Add cs_timegm

Which is a slightly modified version from
https://stackoverflow.com/questions/283166/easy-way-to-convert-a-struct-tm-expressed-in-utc-to-time-t-type

PUBLISHED_FROM=b73f920ca42c45473c23337782e815306bdf69f1
This commit is contained in:
Dmitry Frank authored and Cesanta Bot committed 2017-09-12 16:20:16 +00:00
1 parent 3d6b568c6e
commit 0aaba7a461
2 files changed
+43

No files matched your search

+8
View File
@@ -1797,6 +1797,8 @@ void cs_hmac_sha1(const unsigned char *key, size_t key_len,
#ifndef CS_COMMON_CS_TIME_H_
#define CS_COMMON_CS_TIME_H_
#include <time.h>
/* Amalgamated: #include "common/platform.h" */
#ifdef __cplusplus
@@ -1806,6 +1808,12 @@ extern "C" {
/* Sub-second granularity time(). */
double cs_time(void);
/*
* Similar to (non-standard) timegm, converts broken-down time into the number
* of seconds since Unix Epoch.
*/
double cs_timegm(const struct tm *tm);
#ifdef __cplusplus
}
#endif /* __cplusplus */