MCPcopy
hub / github.com/simstudioai/sim / zonedClockDate

Function zonedClockDate

apps/sim/lib/core/utils/timezone.ts:117–122  ·  view source on GitHub ↗
(instant: Date, timeZone: string)

Source from the content-addressed store, hash-verified

115 * the true instant always lives alongside it (e.g. a task's `runAt`).
116 */
117export function zonedClockDate(instant: Date, timeZone: string): Date {
118 const [datePart, timePart] = zonedWallClock(instant, timeZone).split('T')
119 const [year, month, day] = datePart.split('-').map(Number)
120 const [hour, minute] = timePart.split(':').map(Number)
121 return new Date(year, month - 1, day, hour, minute)
122}
123
124/** The UTC offset (ms, east-positive) of `timeZone` at a given instant. */
125function timezoneOffsetMs(instant: Date, timeZone: string): number {

Callers 5

timezone.test.tsFile · 0.90
ScheduleCalendarFunction · 0.90
CurrentTimeIndicatorFunction · 0.90
taskToCalendarEventFunction · 0.90
useCalendarFunction · 0.90

Calls 1

zonedWallClockFunction · 0.85

Tested by

no test coverage detected