MCPcopy Create free account
hub / github.com/emmnull/drizzle-orm-helpers / dateToString

Function dateToString

src/pg/validation.ts:34–40  ·  view source on GitHub ↗
(date: Date, withTimezone?: boolean)

Source from the content-addressed store, hash-verified

32}
33
34function dateToString(date: Date, withTimezone?: boolean) {
35 if (withTimezone) {
36 return date.toISOString();
37 }
38 const tzOffset = date.getTimezoneOffset() * 6_000;
39 return new Date(date.valueOf() - tzOffset).toISOString().slice(0, -1);
40}
41
42/**
43 * Because of typescript's peculiar handling of Inifinity/-Infinity, ranges without limit need to

Callers 1

toModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected