@block
Return [number, timestamp] of the latest or a specific block.
Returns: any
Syntax
Section titled “Syntax”@block(blockNumber?)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
[blockNumber] |
number |
Block number (omit for latest) |
Examples
Section titled “Examples”# Get latest block number and timestampset [$num $timestamp] @block()print $numprint $timestamp
# Get a specific block's timestampset [$num $timestamp] @block(1)print $timestampSee Also
Section titled “See Also”- @date — convert a date to a Unix timestamp