Skip to content

chopZonedTimezone

chopZonedTimezone(value: string): string
import { chopZonedTimezone } from "@northguild/gmt/zoned/chop";

Returns the local plain datetime (date + time) extracted from a zoned datetime string.

  • Extracts both date and time components from a ZonedDateTime.
  • Returns “” for invalid input.
Parameter Type Description
value string ISO 8601 zoned datetime string

Local plain datetime string or “” for invalid

chopZonedTimezone("2024-02-29T14:30:45.123-05:00[America/New_York]") // "2024-02-29T14:30:45.123"
chopZonedTimezone("invalid") // ""

zoned/chop/chopZonedTimezone.ts