Learn getBlockTime use cases, code examples, request parameters, response structure, and tips.
getBlockTime
RPC method provides the estimated production time of a specified block, identified by its slot number. The time is returned as a Unix timestamp (seconds since the Unix epoch).
This method is useful when you need to correlate block production with real-world time.
getBlockTime
method takes a single parameter:
slot
(u64, required): The slot number of the block for which to retrieve the estimated production time.result
field of the JSON-RPC response will be either:
timestamp
(i64): The estimated production time as a Unix timestamp (seconds since the Unix epoch).null
: If the timestamp is not available for the specified block (e.g., the block is very old and the data has been pruned, or the block was skipped and has no associated timestamp).SLOT_NUMBER_TO_QUERY
with an actual, recent, and confirmed slot on the network you are targeting (e.g., Mainnet Beta or Devnet).
null
.getBlockTime
to retrieve the estimated production timestamp for any given block on the Solana network.