summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-04-15 14:31:23 +0800
committerMeco Man <[email protected]>2021-04-15 14:31:23 +0800
commitb74022e2c4274698aa26a18cbd6df72842f8ac38 (patch)
tree46b07f5558ce55aa4eae588a6d99ce057f4e5501 /components/libc
parent8e2a456d7a1ffff4a35ba9f4c5a199eac14e132e (diff)
mktime support fixed timezone
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/compilers/common/time.c8
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);