Summary
Create a utility (Lua module or parser function) to convert Ethereum blockheights to human-readable datetimes.
Use case
Shows and other time-anchored content use blockheight as the canonical timestamp. But for display, we need to render "January 15, 2026 8:30 PM" rather than "block 21850000".
Implementation options
1. Lua module
{{#invoke:BlockHeight|toDate|21850000}}
→ January 15, 2026
{{#invoke:BlockHeight|toDateTime|21850000|format=Y-m-d H:i}}
→ 2026-01-15 20:30
2. Lookup table
Pre-compute a table of blockheight ranges to dates. Ethereum averages ~12 seconds per block, so we can estimate with reasonable accuracy and cache known blocks.
3. External API
Hit etherscan/blockscout API for exact timestamps. Would need caching strategy.
Considerations
- Accuracy vs performance tradeoff
- Caching strategy for repeated lookups
- Timezone handling (store UTC, display local?)
- Historical blocks (exact) vs future blocks (estimated)
Related
Summary
Create a utility (Lua module or parser function) to convert Ethereum blockheights to human-readable datetimes.
Use case
Shows and other time-anchored content use blockheight as the canonical timestamp. But for display, we need to render "January 15, 2026 8:30 PM" rather than "block 21850000".
Implementation options
1. Lua module
{{#invoke:BlockHeight|toDate|21850000}} → January 15, 2026 {{#invoke:BlockHeight|toDateTime|21850000|format=Y-m-d H:i}} → 2026-01-15 20:302. Lookup table
Pre-compute a table of blockheight ranges to dates. Ethereum averages ~12 seconds per block, so we can estimate with reasonable accuracy and cache known blocks.
3. External API
Hit etherscan/blockscout API for exact timestamps. Would need caching strategy.
Considerations
Related