Skip to content

chopZonedDate

chopZonedDate(value: string): string

Extracts the local time portion from an ISO 8601 zoned datetime string.

  • Extracts time components (hour, minute, second, subsecond) from a ZonedDateTime.
  • Returns "" for invalid input.
ParameterTypeDescription
valuestringISO 8601 zoned datetime string

The local time portion as HH:MM:SS(.SSS) or "" for invalid

import { chopZonedDate } from "@northguild/gmt/zoned/chop";
chopZonedDate("2024-02-29T14:30:45.123-05:00[America/New_York]") // "14:30:45.123"
output 

zoned/chop/chopZonedDate.ts