MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / modSetTime

Function modSetTime

xs/platforms/esp/xsHost.c:703–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701}
702
703void modSetTime(uint32_t seconds)
704{
705#if !ESP32
706 struct rtc_timeval rtc_tv;
707
708 if (!gRTCInit) {
709 rtctime_early_startup();
710 rtctime_late_startup();
711 gRTCInit = true;
712 }
713
714 rtc_tv.tv_sec = seconds;
715 rtc_tv.tv_usec = 0;
716
717 rtctime_settimeofday(&rtc_tv);
718#else
719 struct timeval tv;
720 struct timezone tz;
721
722 tv.tv_sec = seconds;
723 tv.tv_usec = 0;
724
725 settimeofday(&tv, NULL); //@@ implementation doesn't use timezone yet....
726#endif
727}
728
729#if ESP32
730static void updateTZ(void)

Callers 3

modGetTimeOfDayFunction · 0.70
doRemoteCommandFunction · 0.70
xs_time_setFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected