Time

Github Repo C Header C source JS source
cesanta/mongoose-os mgos_time.h mgos_time.c  

mgos_uptime

double mgos_uptime(void);

Get number of seconds since last reboot

mgos_strftime

int mgos_strftime(char *s, int size, char *fmt, int time);

Format time according to a strftime()-conformant format. Write the result into the s,size buffer. Return resulting string length.

mgos_settimeofday

int mgos_settimeofday(double time, struct timezone *tz);

Like standard settimeofday(), but uses double seconds value instead of struct timeval *tv. If time was changed successfully, emits an event MGOS_EVENT_TIME_CHANGED.

edit this doc