MCPcopy Create free account
hub / github.com/F-Stack/f-stack / main

Function main

app/redis-6.2.6/src/localtime.c:109–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107#include <stdio.h>
108
109int main(void) {
110 /* Obtain timezone and daylight info. */
111 tzset(); /* Now 'timezome' global is populated. */
112 time_t t = time(NULL);
113 struct tm *aux = localtime(&t);
114 int daylight_active = aux->tm_isdst;
115
116 struct tm tm;
117 char buf[1024];
118
119 nolocks_localtime(&tm,t,timezone,daylight_active);
120 strftime(buf,sizeof(buf),"%d %b %H:%M:%S",&tm);
121 printf("[timezone: %d, dl: %d] %s\n", (int)timezone, (int)daylight_active, buf);
122}
123#endif

Callers

nothing calls this directly

Calls 2

nolocks_localtimeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected