golos.js
async function getCurrentServerTimeAndBlock() {
    await retrieveDynGlobProps();
    if(props.time) { 
        lastCommitedBlock = props.last_irreversible_block_num;
        trace("lastCommitedBlock = " + lastCommitedBlock + ", headBlock = " + props.head_block_number);
        return {
            time : Date.parse(props.time), 
            block : props.head_block_number,
            commited_block :  props.last_irreversible_block_num
        };
    }
    throw "Current time could not be retrieved";
}
async function getCurrentServerTimeAndBlock() {
    await retrieveDynGlobProps();
    if(props.time) { 
        lastCommitedBlock = props.last_irreversible_block_num;
        trace("lastCommitedBlock = " + lastCommitedBlock + ", headBlock = " + props.head_block_number);
        return {
            time : Date.parse(props.time), 
            block : props.head_block_number,
            commited_block :  props.last_irreversible_block_num
        };
    }
    throw "Current time could not be retrieved";
}
async function getCurrentServerTimeAndBlock ( ) { await retrieveDynGlobProps ( ) ; if ( props . time ) { lastCommitedBlock = props . last_irreversible_block_num ; trace ( "lastCommitedBlock = " + lastCommitedBlock + ", headBlock = " + props . head_block_number ) ; return { time : Date . parse ( props . time ) , block : props . head_block_number , commited_block : props . last_irreversible_block_num } ; } throw "Current time could not be retrieved" ; }
time in milliseconds
time in milliseconds