(self: DateTime): stringFormats a DateTime as a UTC ISO date string.
Details
Returns only the date part (YYYY-MM-DD) in UTC, ignoring any time zone.
Example (Formatting DateTime values as UTC ISO dates)
import { DateTime } from "effect"
const dt = DateTime.makeUnsafe("2024-01-01T23:30:00Z")
console.log(DateTime.formatIsoDateUtc(dt)) // "2024-01-01"
const zoned = DateTime.makeZonedUnsafe("2024-01-01T23:30:00Z", {
timeZone: "Pacific/Auckland"
})
console.log(DateTime.formatIsoDateUtc(zoned)) // "2024-01-01" (always UTC)formatting
Source effect/DateTime.ts:27451 lines
export const const formatIsoDateUtc: (
self: DateTime
) => string
Formats a DateTime as a UTC ISO date string.
Details
Returns only the date part (YYYY-MM-DD) in UTC, ignoring any time zone.
Example (Formatting DateTime values as UTC ISO dates)
import { DateTime } from "effect"
const dt = DateTime.makeUnsafe("2024-01-01T23:30:00Z")
console.log(DateTime.formatIsoDateUtc(dt)) // "2024-01-01"
const zoned = DateTime.makeZonedUnsafe("2024-01-01T23:30:00Z", {
timeZone: "Pacific/Auckland"
})
console.log(DateTime.formatIsoDateUtc(zoned)) // "2024-01-01" (always UTC)
formatIsoDateUtc: (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) => string = import InternalInternal.const formatIsoDateUtc: (
self: DateTime.DateTime
) => string
formatIsoDateUtc