MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / g

Function g

host/time/src/main/fmt.js:15–15  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

13// Date -> struct_time JSON, CPython order (Y, m, d, H, M, S, wday, yday, isdst).
14const toTuple = (dt, utc) => {
15 const g = (m) => (utc ? dt["getUTC" + m]() : dt["get" + m]());
16 const yday = Math.floor((Date.UTC(g("FullYear"), g("Month"), g("Date")) - Date.UTC(g("FullYear"), 0, 1)) / 86400000) + 1;
17 return JSON.stringify([g("FullYear"), g("Month") + 1, g("Date"), g("Hours"), g("Minutes"), g("Seconds"), cpyWday(g("Day")), yday, -1]);
18};

Callers 1

toTupleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected