Sfoglia il codice sorgente

fix: rtc返回的时间错误,不应该是本地时间

Wendal Chen 2 anni fa
parent
commit
659a02c0a0
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      luatos/components/luat/port/luat_rtc_idf5.c

+ 1 - 1
luatos/components/luat/port/luat_rtc_idf5.c

@@ -22,7 +22,7 @@ int luat_rtc_set(struct tm *tblock){
 int luat_rtc_get(struct tm *tblock){
     time_t now = {0};
     time(&now);
-    localtime_r(&now, tblock);
+    gmtime_r(&now, tblock);
     return 0;
 }