📄 settimeofday.c
字号:
#include <sysdefs.h>#include <time.h>#include <sys/time.h>#include <sysdefs.h>#include <time.h>int settimeofday (const struct timeval * newDate, const struct timezone * tz){struct tm newTime;time_t epochTime = newDate->tv_sec; // convert from unix seconds into discrete time elements.#ifdef HAS_CLOCK localtime_r(&epochTime, &newTime); newTime.tm_year += 1900; newTime.tm_mon += 1; newTime.tm_yday += 1; writeRTC (&newTime);#endif return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -