# chopUtc

Industry: Core

## Signature

```ts
chopUtc(value: string): string
```

Return 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 `…Z` and nothing after.
- Returns "" for invalid input.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | UTC datetime string (ISO 8601) |

## Returns

UTC datetime string without trailing Z or "" on invalid input

## Examples

```ts
import { chopUtc } from "@northguild/gmt/utc/chop";

chopUtc("2024-03-10T12:00:00Z") // "2024-03-10T12:00:00"
```

## Source

[utc/chop/chopUtc.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/utc/chop/chopUtc.ts)
