<A>(f: (date: Date) => A): (self: DateTime) => A
<A>(self: DateTime, f: (date: Date) => A): AApplies a function to a JavaScript Date representing the DateTime's UTC
instant and returns the function's result.
Details
This ignores any associated time zone. Use DateTime.withDate when the
callback should receive the time-zone-adjusted wall-clock date.
Example (Applying UTC Dates)
import { DateTime } from "effect"
// get the date in milliseconds
DateTime.makeUnsafe(0).pipe(
DateTime.withDateUtc((date) => date.getTime())
)export const const withDateUtc: {
<A>(f: (date: Date) => A): (self: DateTime) => A
<A>(self: DateTime, f: (date: Date) => A): A
}
Applies a function to a JavaScript Date representing the DateTime's UTC
instant and returns the function's result.
Details
This ignores any associated time zone. Use DateTime.withDate when the
callback should receive the time-zone-adjusted wall-clock date.
Example (Applying UTC Dates)
import { DateTime } from "effect"
// get the date in milliseconds
DateTime.makeUnsafe(0).pipe(
DateTime.withDateUtc((date) => date.getTime())
)
withDateUtc: {
<function (type parameter) A in <A>(f: (date: Date) => A): (self: DateTime) => AA>(f: (date: Date) => Af: (date: Datedate: Date) => function (type parameter) A in <A>(f: (date: Date) => A): (self: DateTime) => AA): (self: DateTimeself: type DateTime = Utc | ZonedA DateTime represents a point in time. It can optionally have a time zone
associated with it.
Companion namespace containing the public helper types used by DateTime
constructors, parts APIs, formatting, and date/time arithmetic.
DateTime) => function (type parameter) A in <A>(f: (date: Date) => A): (self: DateTime) => AA
<function (type parameter) A in <A>(self: DateTime, f: (date: Date) => A): AA>(self: DateTimeself: type DateTime = Utc | ZonedA DateTime represents a point in time. It can optionally have a time zone
associated with it.
Companion namespace containing the public helper types used by DateTime
constructors, parts APIs, formatting, and date/time arithmetic.
DateTime, f: (date: Date) => Af: (date: Datedate: Date) => function (type parameter) A in <A>(self: DateTime, f: (date: Date) => A): AA): function (type parameter) A in <A>(self: DateTime, f: (date: Date) => A): AA
} = import InternalInternal.const withDateUtc: {
<A>(f: (date: Date) => A): (
self: DateTime.DateTime
) => A
<A>(
self: DateTime.DateTime,
f: (date: Date) => A
): A
}
withDateUtc