(self: DateTime): DateTime.PartsWithWeekdayGets the UTC parts of a DateTime as an object.
Details
The parts will always be in UTC, ignoring any time zone information.
Example (Reading UTC DateTime parts)
import { DateTime } from "effect"
const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:30:45.123Z", {
timeZone: "Europe/London"
})
const parts = DateTime.toPartsUtc(zoned)
console.log(parts)
// Always returns UTC parts regardless of time zoneexport const const toPartsUtc: (
self: DateTime
) => DateTime.PartsWithWeekday
Gets the UTC parts of a DateTime as an object.
Details
The parts will always be in UTC, ignoring any time zone information.
Example (Reading UTC DateTime parts)
import { DateTime } from "effect"
const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:30:45.123Z", {
timeZone: "Europe/London"
})
const parts = DateTime.toPartsUtc(zoned)
console.log(parts)
// Always returns UTC parts regardless of time zone
toPartsUtc: (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) => DateTime.interface DateTime.PartsWithWeekdayCalendar and time components of a DateTime, including the weekday.
Details
month is one-based (1 for January through 12 for December), and
weekDay follows JavaScript Date#getUTCDay numbering (0 for Sunday
through 6 for Saturday).
PartsWithWeekday = import InternalInternal.const toPartsUtc: (
self: DateTime.DateTime
) => DateTime.DateTime.PartsWithWeekday
toPartsUtc