Skip to content

chopZonedSeconds

chopZonedSeconds(value: string): string

Returns the zoned datetime string truncated to minute precision.

  • Removes seconds and milliseconds.
  • Returns "" for invalid input.
ParameterTypeDescription
valuestringISO 8601 zoned datetime string

Zoned datetime string at minute precision or "" for invalid

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

zoned/chop/chopZonedSeconds.ts