# dateToEpoch

> **dateToEpoch**(`date`, `genesisTimestamp`): `bigint`

Defined in: [packages/synapse-core/src/utils/epoch.ts:28](https://github.com/FilOzone/synapse-sdk/blob/278badff6cfc813e6315d00c56f4a5f23c80f883/packages/synapse-core/src/utils/epoch.ts#L28)

Convert a JavaScript Date to a Filecoin epoch

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `date` | [`Date`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date) | The date to convert |
| `genesisTimestamp` | `number` | The genesis timestamp of the chain in seconds (Unix timestamp) |

## Returns

`bigint`

The epoch (rounded down to nearest epoch)