(
options?:
| (Intl.DateTimeFormatOptions & {
readonly locale?: string | undefined
})
| undefined
): (self: DateTime) => string
(
self: DateTime,
options?:
| (Intl.DateTimeFormatOptions & {
readonly locale?: string | undefined
})
| undefined
): stringFormats a DateTime with Intl.DateTimeFormat using the system local time
zone and locale.
Example (Formatting DateTime values locally)
import { DateTime } from "effect"
const dt = DateTime.makeUnsafe("2024-06-15T14:30:00Z")
// Uses system local time zone and locale
const local = DateTime.formatLocal(dt, {
year: "numeric",
month: "long",
day: "numeric",
hour: "2-digit",
minute: "2-digit"
})
console.log(local) // Output depends on system locale/timezoneformatting
Source effect/DateTime.ts:255617 lines
export const const formatLocal: {
(
options?:
| (Intl.DateTimeFormatOptions & {
readonly locale?: string | undefined
})
| undefined
): (self: DateTime) => string
(
self: DateTime,
options?:
| (Intl.DateTimeFormatOptions & {
readonly locale?: string | undefined
})
| undefined
): string
}
Formats a DateTime with Intl.DateTimeFormat using the system local time
zone and locale.
Example (Formatting DateTime values locally)
import { DateTime } from "effect"
const dt = DateTime.makeUnsafe("2024-06-15T14:30:00Z")
// Uses system local time zone and locale
const local = DateTime.formatLocal(dt, {
year: "numeric",
month: "long",
day: "numeric",
hour: "2-digit",
minute: "2-digit"
})
console.log(local) // Output depends on system locale/timezone
formatLocal: {
(
options: | (Intl.DateTimeFormatOptions & {
readonly locale?: string | undefined
})
| undefined
options?:
| Intl.interface Intl.DateTimeFormatOptionsDateTimeFormatOptions & {
readonly locale?: string | undefinedlocale?: string | undefined
}
| undefined
): (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
(
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,
options: | (Intl.DateTimeFormatOptions & {
readonly locale?: string | undefined
})
| undefined
options?:
| Intl.interface Intl.DateTimeFormatOptionsDateTimeFormatOptions & {
readonly locale?: string | undefinedlocale?: string | undefined
}
| undefined
): string
} = import InternalInternal.const formatLocal: {
(
options?:
| (Intl.DateTimeFormatOptions & {
readonly locale?: Intl.LocalesArgument
})
| undefined
): (self: DateTime.DateTime) => string
(
self: DateTime.DateTime,
options?:
| (Intl.DateTimeFormatOptions & {
readonly locale?: Intl.LocalesArgument
})
| undefined
): string
}
formatLocal