pub fn timestamp_of_block(block_height: u32) -> u64 
Expand description

Get the TAI64 timestamp of a block at a given block_height.

Additional Information

The TAI64 timestamp begins at 262 seconds before 1970, and ends at 262 seconds after 1970,
with a TAI second defined as the duration of 9192631770 periods of the radiation corresponding
to the transition between the two hyperfine levels of the ground state of the cesium atom.

Arguments

  • block_height: [u32] - The height of the block to get the timestamp of.

Returns

  • [u64] - The TAI64 timestamp of the block at block_height.

Examples

use std::block::timestamp_of_block;

fn foo() {
    let timestamp_of_block_100 = timestamp_of_block(100u32);
    log(timestamp_of_block_100);
}