AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.

Start building today!     

Contents

getBlockTime RPC Method

The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. u64 - integer - The block number, identified by Slot

Returns:

  1. result - The response can be either of one value:

    i64 - The estimated production time, as Unix timestamp (seconds since the Unix epoch)

    null - If timestamp is not available for the block

Code Examples:

const web3 = require("@solana/web3.js");
(async () => {
  const solana = new web3.Connection("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/");
  console.log(await solana.getBlockTime(94101948));
})();
Ready to get started? Create a free account