mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-21 05:27:10 +08:00
mktime support fixed timezone
This commit is contained in:
parent
8e2a456d7a
commit
b74022e2c4
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user