MCPcopy
hub / github.com/date-fns/date-fns / targetInternalTime

Function targetInternalTime

pkgs/tz/src/date/mini.js:520–529  ·  view source on GitHub ↗
(date, time)

Source from the content-addressed store, hash-verified

518}
519
520function targetInternalTime(date, time) {
521 // Compute the target-zone wall-clock representation for a timestamp without
522 // mutating the TZDate. This mirrors syncToInternal for temporary checks.
523 const internal = new Date(time ?? +date);
524 internal.setUTCSeconds(
525 internal.getUTCSeconds() -
526 Math.round(-tzOffset(date.timeZone, internal) * 60),
527 );
528 return +internal;
529}

Callers 1

adjustToSystemTZFunction · 0.85

Calls 1

tzOffsetFunction · 0.90

Tested by

no test coverage detected