(part: keyof DateTime.PartsWithWeekday): (self: DateTime) => number
(self: DateTime, part: keyof DateTime.PartsWithWeekday): numberGets one UTC part of a DateTime as a number.
Details
The part will be in the UTC time zone.
Example (Reading UTC DateTime parts by key)
import { DateTime } from "effect"
const dateTime = DateTime.makeUnsafe({ year: 2024 })
const year = DateTime.getPartUtc(dateTime, "year")
console.log(year) // 2024export const const getPartUtc: {
(part: keyof DateTime.PartsWithWeekday): (
self: DateTime
) => number
(
self: DateTime,
part: keyof DateTime.PartsWithWeekday
): number
}
Gets one UTC part of a DateTime as a number.
Details
The part will be in the UTC time zone.
Example (Reading UTC DateTime parts by key)
import { DateTime } from "effect"
const dateTime = DateTime.makeUnsafe({ year: 2024 })
const year = DateTime.getPartUtc(dateTime, "year")
console.log(year) // 2024
getPartUtc: {
(part: keyof DateTime.PartsWithWeekdaypart: keyof 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): (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) => number
(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, part: keyof DateTime.PartsWithWeekdaypart: keyof 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): number
} = import InternalInternal.const getPartUtc: {
(
part: keyof DateTime.DateTime.PartsWithWeekday
): (self: DateTime.DateTime) => number
(
self: DateTime.DateTime,
part: keyof DateTime.DateTime.PartsWithWeekday
): number
}
getPartUtc