Function std::block::timestamp

pub fn timestamp() -> u64 
Expand description

Get the TAI64 timestamp of the current block.

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.

Returns

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

Examples

use std::block::timestamp;

fn foo() {
    let current_timestamp = timestamp();
    log(current_timestamp);
}