MCPcopy Index your code
hub / github.com/Effect-TS/effect / DateTimeUtcFromNumber

Class DateTimeUtcFromNumber

packages/effect/src/Schema.ts:6907–6915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6905 * @since 3.10.0
6906 */
6907export class DateTimeUtcFromNumber extends transformOrFail(
6908 Number$.annotations({ description: "a number to be decoded into a DateTime.Utc" }),
6909 DateTimeUtcFromSelf,
6910 {
6911 strict: true,
6912 decode: (i, _, ast) => decodeDateTimeUtc(i, ast),
6913 encode: (a) => ParseResult.succeed(dateTime.toEpochMillis(a))
6914 }
6915).annotations({ identifier: "DateTimeUtcFromNumber" }) {}
6916
6917/**
6918 * Defines a schema that attempts to convert a `Date` to a `DateTime.Utc` instance using the `DateTime.unsafeMake` constructor.

Callers

nothing calls this directly

Calls 3

transformOrFailInterface · 0.85
decodeDateTimeUtcFunction · 0.85
annotationsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…