MCPcopy Create free account
hub / github.com/chen3feng/toft / UtcToday

Method UtcToday

system/time/date.cpp:244–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244Date Date::UtcToday() {
245 struct tm* tm;
246 struct tm tms;
247 time_t t = time(NULL);
248#if _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE || _POSIX_SOURCE
249 tm = gmtime_r(&t, &tms);
250#else
251 tm = gmtime(&t); // NOLINT(runtime/threadsafe_fn)
252#endif
253 return Date(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday);
254}
255
256bool Date::IsLeapYear(int year) {
257 return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;

Callers

nothing calls this directly

Calls 1

DateClass · 0.85

Tested by

no test coverage detected