# isBeforeDateTime

Industry: Core

## Signature

```ts
isBeforeDateTime(value1: string, value2: string): boolean
```

Return true when `value1` is strictly before `value2` for PlainDateTime values.

- Uses Temporal.PlainDateTime.compare to compare date-times.
- Returns false if either input is invalid.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value1` | `string` | ISO PlainDateTime string for the first value |
| `value2` | `string` | ISO PlainDateTime string for the second value |

## Returns

boolean indicating whether value1 &lt; value2

## Examples

```ts
import { isBeforeDateTime } from "@northguild/gmt/plain/compare";

isBeforeDateTime("2024-02-28T12:34:56", "2024-02-29T12:34:56") // true
```

## Source

[plain/compare/isBeforeDateTime.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/plain/compare/isBeforeDateTime.ts)
