API ReferenceAdvanced utilities and typesFunction
dateToEthereumTimestamp()
function dateToEthereumTimestamp(d): bigint;Converts a JavaScript Date to the Unix-seconds bigint the protocol uses for every on-chain
timestamp (expirationTimestampSeconds, createdTimestampSeconds). Truncates sub-second precision
toward zero. Inverse of ethereumTimestampToDate.
Parameters
| Parameter | Type | Description |
|---|---|---|
d | Date | The date to convert. |
Returns
bigint
Whole Unix seconds since the epoch.