11#define TZ_OFFSET_SECS 0
13static const char *
dayOfWeek[7] = {
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat" };
15 "Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
16 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
23 time_t sec = nsec / 1000000000;
36 tv->
tv_sec = nsec / 1000000000;
37 tv->
tv_usec = (nsec % 1000000000) / 1000;
88 if ((year % 100) != 0)
90 if ((year % 400) != 0)
98 static const uint64_t days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
115 secs = *timep % (60 * 60 * 24);
116 days = *timep / (60 * 60 * 24);
133 for (y = 1970; ; y++) {
141 if (days < daysOfYear) {
152 if (days < daysOfMonth) {
char * asctime_r(const struct tm *tm, char *buf)
struct tm * localtime(const time_t *timep)
struct tm * gmtime(const time_t *timep)
char * ctime_r(const time_t *timep, char *buf)
int settimeofday(const struct timeval *tv, const struct timezone *tz)
struct tm * gmtime_r(const time_t *timep, struct tm *tm)
static const char * months[12]
int gettimeofday(struct timeval *tv, struct timezone *tz)
struct tm * localtime_r(const time_t *timep, struct tm *result)
char * ctime(const time_t *timep)
static int Time_DaysInMonth(uint64_t year, uint64_t month)
static const char * dayOfWeek[7]
static bool Time_IsLeapYear(uint64_t year)
char * asctime(const struct tm *tm)
time_t mktime(struct tm *tm)
int snprintf(char *str, size_t size, const char *fmt,...) __printflike(3