diff options
| author | Meco Man <[email protected]> | 2021-02-07 21:08:41 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-02-07 21:08:41 +0800 |
| commit | f073911cd32bf8bfd02d6945db230e5e7b9b75ea (patch) | |
| tree | dcc48ceaf009960e89defb3ce712dc7feccec4a9 /components/drivers/rtc/soft_rtc.c | |
| parent | 852d7d7552bd3fe898115ea16ba401970b0d1fad (diff) | |
解决底层驱动格林威治时间与当地时间胡乱使用的问题 mktime函数改为timegm函数
Diffstat (limited to 'components/drivers/rtc/soft_rtc.c')
| -rw-r--r-- | components/drivers/rtc/soft_rtc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/drivers/rtc/soft_rtc.c b/components/drivers/rtc/soft_rtc.c index 6a04314675..240301f683 100644 --- a/components/drivers/rtc/soft_rtc.c +++ b/components/drivers/rtc/soft_rtc.c @@ -8,7 +8,7 @@ * 2018-01-30 armink the first version */ -#include <time.h> +#include <sys/time.h> #include <string.h> #include <rtthread.h> #include <rtdevice.h> @@ -126,7 +126,7 @@ int rt_soft_rtc_init(void) #endif init_tick = rt_tick_get(); - init_time = mktime(&time_new); + init_time = timegm(&time_new); soft_rtc_dev.type = RT_Device_Class_RTC; |
