chopUtc
Signature
Section titled “Signature”chopUtc(value: string): stringReturn the UTC datetime string with a trailing Z removed if present.
- Removes the trailing “Z”; a lower-case “z” is not a GMT UTC string (
isValidUtc), so it returns "". - Returns "" for a string with any annotation (
[foo=bar],[u-ca=iso8601],[Europe/Paris]): a UTC string is…Zand nothing after. - Returns "" for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | UTC datetime string (ISO 8601) |
Returns
Section titled “Returns”UTC datetime string without trailing Z or "" on invalid input
Examples
Section titled “Examples”import { chopUtc } from "@northguild/gmt/utc/chop";
chopUtc("2024-03-10T12:00:00Z") // "2024-03-10T12:00:00"Source
Section titled “Source”Accessibility
© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.