瀏覽代碼

修改时区计算公式的错误

Meco Man 4 年之前
父節點
當前提交
39ff4b5a97
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      components/libc/compilers/common/time.c

+ 3 - 3
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);
 }