Skip to main content

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​

NameTypeRequiredDescription
unixtimelongNoUnix timestamp in seconds. If omitted, defaults to the current system time.

Response​

{
"time": 1700000000
}

Response Fields​

FieldTypeDescription
timelongCurrent 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"