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

Function resetTimezone

src/date.ts:4–14  ·  view source on GitHub ↗
(date: Date)

Source from the content-addressed store, hash-verified

2const lru = new LRU(1000); // Cache up to 1000 entries
3
4export function resetTimezone(date: Date) {
5 let TIMEZONE: string = '';
6 const offsetInMinutes = date.getTimezoneOffset();
7 const _hourOffset: number = Math.floor(-offsetInMinutes / 60);
8 const _minuteOffset: number = Math.abs(offsetInMinutes % 60);
9
10 TIMEZONE += _hourOffset >= 0 ? '+' : '-';
11 TIMEZONE += `${String(Math.abs(_hourOffset)).padStart(2, '0')}${String(_minuteOffset).padStart(2, '0')}`;
12
13 return TIMEZONE;
14}
15
16const MONTHS: Record<string, string> = {
17 '01': 'Jan',

Callers 1

getTimezoneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…