add timegm function (inverse of gmtime), nonstandard

This commit is contained in:
Rich Felker 2012-06-13 14:41:52 -04:00
parent 2169265ec6
commit 23be72ae45
2 changed files with 12 additions and 0 deletions

View File

@ -114,6 +114,9 @@ struct tm *getdate (const char *);
int stime(time_t *);
#endif
#if defined(_GNU_SOURCE)
time_t timegm(struct tm *);
#endif
#ifdef __cplusplus
}

9
src/time/timegm.c Normal file
View File

@ -0,0 +1,9 @@
#define _GNU_SOURCE
#include <time.h>
#include "__time.h"
time_t timegm(struct tm *tm)
{
return __tm_to_time(tm);
}