# 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/7004ea9b9f1577216826ff17bb7f17f4873d9057/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`)