# getBlockTime

Solana API method that returns the estimated production time of a block.


Each validator regularly reports its UTC time to the ledger by intermittently adding a timestamp to a vote for a particular block. A requested block's time is calculated from the stake-weighted mean of the vote timestamps in a set of recent blocks recorded on the ledger.


  • <u64> — the block, identified by the slot.


  • <i64> — the estimated production time, as a Unix timestamp, seconds since the Unix epoch (opens new window).
  • <null> — if the timestamp is not available for this block.


  • Solana web3.js
  • Solana.py
  • cURL
import { PublicKey, Connection } from "@solana/web3.js"

const nodeUrl = "CHAINSTACK_NODE_URL"
const connect = new Connection(nodeUrl);

(async () => {  
  console.log(await connect.getBlockTime(151696557));