MCPcopy Create free account
hub / github.com/node-modules/utility / getTimezone

Function getTimezone

src/date.ts:66–74  ·  view source on GitHub ↗
(d: Date)

Source from the content-addressed store, hash-verified

64}
65
66export function getTimezone(d: Date) {
67 const key = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
68 const timeZone = lru.get(key);
69 if (timeZone === undefined) {
70 lru.set(key, resetTimezone(d), { maxAge: 86400000 }); // Cache for 24 hours
71 return lru.get(key);
72 }
73 return timeZone;
74}
75/**
76 * Normal log format date. format: `moment().format('YYYY-MM-DD HH:mm:ss.SSS')`
77 */

Callers 1

accessLogDateFunction · 0.85

Calls 1

resetTimezoneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…