Get Epoch Time
Returns the current epoch time (seconds since 1970-01-01 00:00:00 UTC).
Request
GET /nxt?requestType=getEpochTime[&unixtime=<seconds>]
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
unixtime | long | No | Unix timestamp in seconds. If omitted, defaults to the current system time. |
Response
{
"time": 1700000000
}
Response Fields
| Field | Type | Description |
|---|---|---|
time | long | Current epoch time in seconds. |
Notes
- This endpoint does not require the blockchain to be running (
requireBlockchain = false). - Not chain-specific.
- Does not require admin password authentication (
requirePassword = false).
Source: GetEpochTime.java.
Example
curl "http://localhost:22024/nxt?requestType=getEpochTime"