curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "getBlockTime",
"params": [
166974442
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": 123
}
curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "getBlockTime",
"params": [
166974442
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": 123
}
getBlockTime
method returns the estimated production time of a block.
Note that you need to use the slot number as a parameter here, not the block number. See also Understanding the difference between blocks and slots on Solana.
This method provides the Unix timestamp at which the block was produced. It is useful for tracking the timing of transactions and events on the blockchain.
block
— the height of the slot to retrieve the block production time for.value
— the estimated Unix timestamp at which the block was produced.getBlockTime
is to track the timing of transactions and events on the blockchain. This can be useful for block explorers, wallets, or other applications that need to display or make use of this information.Block time details
The response is of type object
.
Was this page helpful?