Hyperlinkv0.8.0-beta.28

DateTime

DateTime.removeTimeconsteffect/DateTime.ts:1680
(self: DateTime): Utc

Removes the time aspect of a DateTime, first adjusting for the time zone. It will return a DateTime.Utc only containing the date.

Example (Removing time components)

import { DateTime } from "effect"

// returns "2024-01-01T00:00:00Z"
DateTime.makeZonedUnsafe("2024-01-01T05:00:00Z", {
  timeZone: "Pacific/Auckland",
  adjustForTimeZone: true
}).pipe(
  DateTime.removeTime,
  DateTime.formatIso
)
converting
export const removeTime: (self: DateTime) => Utc = Internal.removeTime