MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / IsLeapYear

Function IsLeapYear

Sources/Shared/Containers/DateTime.cpp:56–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 };
55
56 static bool IsLeapYear(std::int32_t year) noexcept
57 {
58 if (year == -1) {
59 year = DateTime::UtcNow().GetYear();
60 }
61
62 return (year % 4 == 0 && ((year % 100) != 0 || (year % 400) == 0));
63 }
64
65 static std::int32_t GetNumberOfDaysInMonth(std::int32_t month, std::int32_t year) noexcept
66 {

Callers 2

GetNumberOfDaysInMonthFunction · 0.85
TryParseFormatFunction · 0.85

Calls 1

GetYearMethod · 0.80

Tested by

no test coverage detected