convertZonedToPlainDateTime
Signature
Section titled “Signature”convertZonedToPlainDateTime(value: string): stringConvert a zoned ISO 8601 datetime string to a plain datetime string.
- Extracts the local date-time components without timezone info.
- Validation is performed on the input.
- The offset is dropped, and with it which occurrence of a repeated wall time was meant. In a fall-back overlap the same plain date-time names two instants; converting back with
convertPlainDateTimeToZonedpicks the earlier one by default. Keep the zoned string, or pass{ disambiguation: "later" }when converting back, to recover the second occurrence.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | zoned ISO 8601 datetime string |
Returns
Section titled “Returns”plain datetime string or "" on invalid input
Examples
Section titled “Examples”import { convertZonedToPlainDateTime } from "@northguild/gmt/zoned/convert";
convertZonedToPlainDateTime("2024-02-29T14:30:45.123-05:00[America/New_York]") // "2024-02-29T14:30:45.123"