Skip to content

chopSeconds

chopSeconds(value: string): string

Return an ISO string with second precision removed from a PlainDateTime or PlainTime value.

  • Truncates to minute precision.
  • Accepts both PlainDateTime and PlainTime formats.
  • Returns "" for invalid input.
ParameterTypeDescription
valuestringISO PlainDateTime or PlainTime string

ISO string trimmed to minutes or "" on invalid input

import { chopSeconds } from "@northguild/gmt/plain/chop";
chopSeconds("2024-02-29T12:34:56") // "2024-02-29T12:34"
output 

plain/chop/chopSeconds.ts