diff options
| author | Meco Man <[email protected]> | 2021-05-01 05:51:18 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-05-01 05:52:55 +0800 |
| commit | a7a3ca9f0290131842f1a40bb8dca1a9490e4d27 (patch) | |
| tree | ec3a2ce69af7910beb0d4ca50b5d1ba261a53a41 /components/libc/compilers/common | |
| parent | 79a452b26d5499466c111d6fceac5b628ff7fdf2 (diff) | |
增加手动设置时区的功能
Diffstat (limited to 'components/libc/compilers/common')
| -rw-r--r-- | components/libc/compilers/common/time.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index 33d8907165..8dda257937 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -214,7 +214,7 @@ struct tm* localtime_r(const time_t* t, struct tm* r) time_t local_tz; int utc_plus; - utc_plus = 8; /* GMT: UTC+8 */ + utc_plus = RT_LIBC_FIXED_TIMEZONE; local_tz = *t + utc_plus * 3600; return gmtime_r(&local_tz, r); } @@ -233,7 +233,7 @@ time_t mktime(struct tm * const t) time_t timestamp; int utc_plus; - utc_plus = 8; /* GMT: UTC+8 */ + utc_plus = RT_LIBC_FIXED_TIMEZONE; timestamp = timegm(t); timestamp = timestamp - 3600 * utc_plus; return timestamp; |
