chopZonedTime
Signature
Section titled “Signature”chopZonedTime(value: string): stringimport { chopZonedTime } from "@northguild/gmt/zoned/chop";Extracts the local date portion from an ISO 8601 zoned datetime string.
- Extracts date components (year, month, day) from a ZonedDateTime.
- Returns “” for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO 8601 zoned datetime string |
Returns
Section titled “Returns”Local date string YYYY-MM-DD or “” for invalid
Examples
Section titled “Examples”chopZonedTime("2024-02-29T14:30:45.123-05:00[America/New_York]") // "2024-02-29"chopZonedTime("invalid") // ""