MCPcopy Create free account
hub / github.com/comaps/comaps / GetUnixtimeByDate

Function GetUnixtimeByDate

libs/platform/platform_tests_support/helpers.cpp:9–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace platform::tests_support
8{
9time_t GetUnixtimeByDate(uint16_t year, Month month, uint8_t monthDay, uint8_t hours, uint8_t minutes)
10{
11 std::tm t{};
12 t.tm_year = year - 1900;
13 t.tm_mon = static_cast<int>(month) - 1;
14 t.tm_mday = monthDay;
15 t.tm_hour = hours;
16 t.tm_min = minutes;
17 return std::mktime(&t);
18}
19
20time_t GetUnixtimeByWeekday(uint16_t year, Month month, Weekday weekday, uint8_t hours, uint8_t minutes)
21{

Callers 3

UNIT_TESTFunction · 0.85
UNIT_CLASS_TESTFunction · 0.85
UNIT_TESTFunction · 0.85

Calls

no outgoing calls

Tested by 3

UNIT_TESTFunction · 0.68
UNIT_CLASS_TESTFunction · 0.68
UNIT_TESTFunction · 0.68