MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / DateTimeToUnixMs

Function DateTimeToUnixMs

source/src/scriptinterpreter.cpp:42–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42time_t DateTimeToUnixMs(time_t hour, time_t min, time_t sec, time_t msec, time_t year, time_t mon, time_t day)
43{
44 std::time_t now = std::time(nullptr);
45 std::tm* timeinfo = std::localtime(&now);
46 timeinfo->tm_hour = hour;
47 timeinfo->tm_min = min;
48 timeinfo->tm_sec = sec;
49 if (year != 0) timeinfo->tm_year = year - 1900;
50 if (mon != 0) timeinfo->tm_mon = mon - 1;
51 if (day != 0) timeinfo->tm_mday = day;
52 return std::mktime(timeinfo) * 1000 + msec;
53}
54
55/*
56int timestamp: sec

Callers 2

execMethod · 0.85
execMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected