diff options
| author | Meco Man <[email protected]> | 2021-04-15 14:31:23 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-04-15 14:31:23 +0800 |
| commit | b74022e2c4274698aa26a18cbd6df72842f8ac38 (patch) | |
| tree | 46b07f5558ce55aa4eae588a6d99ce057f4e5501 /components/libc/compilers/common | |
| parent | 8e2a456d7a1ffff4a35ba9f4c5a199eac14e132e (diff) | |
mktime support fixed timezone
Diffstat (limited to 'components/libc/compilers/common')
| -rw-r--r-- | components/libc/compilers/common/time.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index 75adb817da..638735b77c 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -234,7 +234,13 @@ RTM_EXPORT(localtime); /* TODO: timezone */ time_t mktime(struct tm * const t) { - return timegm(t); + time_t timestamp; + int utc_plus; + + utc_plus = 8; /* GMT: UTC+8 */ + timestamp = timegm(t); + timestamp = timestamp - 3600 * utc_plus; + return timestamp; } RTM_EXPORT(mktime); |
