summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-02-08 11:37:24 +0800
committerMeco Man <[email protected]>2021-02-08 11:37:24 +0800
commit39ff4b5a97accf4a0c2134b8b7b395482fc785fb (patch)
treef5cff1ace2a527873edd8d574bc94bcba6ac2666
parent2645aec2e3b5b805d697b2ec546faeb5157e8d81 (diff)
修改时区计算公式的错误
-rw-r--r--components/libc/compilers/common/time.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c
index 7e4a98f923..2cea9b75ce 100644
--- a/components/libc/compilers/common/time.c
+++ b/components/libc/compilers/common/time.c
@@ -101,10 +101,10 @@ struct tm* gmtime(const time_t* t)
struct tm* localtime_r(const time_t* t, struct tm* r)
{
time_t local_tz;
- int timezone;
+ int utc;
- timezone = 0 * 3600 * 8; /* GTM: UTC+0 */
- local_tz = *t + timezone;
+ utc = 3600 * 0; /* GTM: UTC+0 */
+ local_tz = *t + utc;
return gmtime_r(&local_tz, r);
}