source:
asp3_tinet_ecnl_arm/trunk/musl-1.1.18/src/time/timegm.c
Last change on this file was 352, checked in by , 6 years ago | |
---|---|
|
|
File size: 332 bytes |
Rev | Line | |
---|---|---|
[352] | 1 | #define _GNU_SOURCE |
2 | #include "time_impl.h" | |
3 | #include <errno.h> | |
4 | ||
5 | extern const char __gmt[]; | |
6 | ||
7 | time_t timegm(struct tm *tm) | |
8 | { | |
9 | struct tm new; | |
10 | long long t = __tm_to_secs(tm); | |
11 | if (__secs_to_tm(t, &new) < 0) { | |
12 | errno = EOVERFLOW; | |
13 | return -1; | |
14 | } | |
15 | *tm = new; | |
16 | tm->tm_isdst = 0; | |
17 | tm->__tm_gmtoff = 0; | |
18 | tm->__tm_zone = __gmt; | |
19 | return t; | |
20 | } |
Note:
See TracBrowser
for help on using the repository browser.