Github Repo | C Header | C source | JS source |
---|---|---|---|
cesanta/mongoose-os | mgos_time.h | mgos_time.c |
double mgos_uptime(void);
Get number of seconds since last reboot
int64_t mgos_uptime_micros(void);
Get number of microseconds since last reboot
int mgos_strftime(char *s, int size, char *fmt, int time);
Format
time
according to astrftime()
-conformant format. Write the result into thes,size
buffer. Return resulting string length.
int mgos_settimeofday(double time, struct timezone *tz);
edit this docLike standard
settimeofday()
, but usesdouble
seconds value instead ofstruct timeval *tv
. If time was changed successfully, emits an eventMGOS_EVENT_TIME_CHANGED
.