# isValidSwiftDate

Industry: Finance

:::caution[Unreleased]
Not in `@northguild/gmt` 1.21.0 on npm yet. It is on `main` and ships in the next release.
:::

## Signature

```ts
isValidSwiftDate(value: string): boolean
```

Return true when `value` is a SWIFT MT value date, `YYMMDD`, that SWIFT accepts.

- **True exactly when `parseSwiftDate` returns a date** for the same value. It calls the parser, so the two cannot disagree.
- **It needs no options.** SWIFT's value-date rule fixes the year: a `YY` from `01` to `60` is 20`YY`, and any other is refused. So a value is valid or not on its own: `040229` is valid (2004), and `990615` and `000229` are not (error T50).
- False for a value that is not a string.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | The value to check |

## Returns

`true` for a value date SWIFT accepts, or `false` on invalid input

## Examples

```ts
import { isValidSwiftDate } from "@northguild/gmt/finance/validate";

isValidSwiftDate("240615") // true
```

## Source

[finance/validate/isValidSwiftDate.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/finance/validate/isValidSwiftDate.ts)
