MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / DateTimeFromJSDate

Function DateTimeFromJSDate

src/NodeRTLib/ProjectFiles/NodeRtUtils.cpp:320–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320::Windows::Foundation::DateTime DateTimeFromJSDate(Local<Value> value) {
321 ::Windows::Foundation::DateTime time;
322 time.UniversalTime = 0;
323 if (value->IsDate()) {
324 // 116444736000000000 = The time in 100 nanoseconds between 1/1/1970(UTC) to
325 // 1/1/1601(UTC) ux_time = (Current time since 1601 in 100 nano sec
326 // units)/10000 - 116444736000000000;
327 time.UniversalTime = value->IntegerValue() * 10000 + 116444736000000000;
328 }
329
330 return time;
331}
332
333Local<Date> DateTimeToJS(::Windows::Foundation::DateTime value) {
334 // 116444736000000000 = The time 100 nanoseconds between 1/1/1970(UTC) to

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected