MCPcopy Create free account
hub / github.com/freecodexyz/free-code / formatUtcTimeAsLocal

Function formatUtcTimeAsLocal

src/utils/cron.ts:207–216  ·  view source on GitHub ↗
(minute: number, hour: number)

Source from the content-addressed store, hash-verified

205}
206
207function formatUtcTimeAsLocal(minute: number, hour: number): string {
208 // Create a date in UTC and format in user's local timezone
209 const d = new Date()
210 d.setUTCHours(hour, minute, 0, 0)
211 return d.toLocaleTimeString('en-US', {
212 hour: 'numeric',
213 minute: '2-digit',
214 timeZoneName: 'short',
215 })
216}
217
218export function cronToHuman(cron: string, opts?: { utc?: boolean }): string {
219 const utc = opts?.utc ?? false

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected