# epochToDate

> **epochToDate**(`epoch`, `genesisTimestamp`): [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) \| `null`

Defined in: [packages/synapse-core/src/utils/epoch.ts:16](https://github.com/FilOzone/synapse-sdk/blob/840d7b2c6263846ac51b7558000e62dd68d33a44/packages/synapse-core/src/utils/epoch.ts#L16)

Convert a Filecoin epoch to a JavaScript Date

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `epoch` | `bigint` | The epoch to convert |
| `genesisTimestamp` | `number` | The genesis timestamp of the chain in seconds (Unix timestamp) |

## Returns

[`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) \| `null`

Date of the epoch, or `null` when it is past the `Date` range
(e.g. the `maxUint256` "never" sentinel used by `runwayInEpochs`)