# minUtc

Industry: Core

## Signature

```ts
minUtc(utcDateTimes: string[]): string | null
```

Return the earliest (minimum) of the given UTC datetime values.

- Filters invalid values before finding minimum using Temporal.Instant.compare.
- Returns null if array is empty or has no valid values.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `utcDateTimes` | `string[]` | Array of ISO datetime strings (e.g. "2024-03-10T12:00:00Z") |

## Returns

The earliest UTC datetime string, or null on invalid input

## Examples

```ts
import { minUtc } from "@northguild/gmt/utc/calculate";

minUtc(["2024-03-10T12:00:00Z", "2024-03-15T12:00:00Z", "2024-03-12T12:00:00Z"]) // "2024-03-10T12:00:00Z"
```

## Source

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