OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Ethereum Block By Date

Ethereum Block By Date is a JavaScript library that finds Ethereum block numbers for a specified date or recurring time interval. It accepts web3.js, ethers.js and viem client objects and returns block-number results with dates and timestamps.

Independent OpenViST project profile, based on linked sources.

Ethereum Block By Date — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when application logic starts with calendar dates or intervals and needs corresponding Ethereum block numbers.

Who it is for

  • JavaScript developers building Ethereum analytics or historical-data tools.
  • Teams selecting blockchain data by date or recurring time period.

Documented uses

  • Resolve the nearest Ethereum block for a particular date.
  • Generate block references at regular intervals such as every few hours or weeks.
  • Use date-based block selection in an application built with web3.js, ethers.js or viem.
Before you choose

Requirements & limits

  • The caller must provide an Ethereum client object; the package is a library rather than a hosted lookup service.
  • The README describes support for Ethereum-based mainnet and testnet networks.
  • Date parsing uses Moment.js-supported values and timezone handling.
  • A lookup before the first block returns block 1, while a future date returns the latest block.
  • The repository lists a JavaScript implementation and MIT license.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install and initialize the library

Add the package to a JavaScript project and initialize it with an Ethereum client.

Before you start

  • A JavaScript project using npm or yarn.
  • A web3.js, ethers.js or viem client connected to an Ethereum-based network.

Steps

  1. Install with the command below or yarn add ethereum-block-by-date.

    Documented command
    npm i ethereum-block-by-date
  2. Create a web3.js object, ethers provider or viem client.

  3. Require ethereum-block-by-date and pass the client object to new EthDater(...).

Expected outcome

An EthDater instance initialized with the supplied Ethereum client.

Guide limitations

  • The repository documents initialization; this guide does not cover executing a lookup.
  • The examples require an Ethereum client object.
Source-based practical guide

Look up blocks across a time interval

Request block-number results at recurring points between two dates.

Before you start

  • An initialized EthDater instance.
  • A valid period, start date and end date.

Steps

  1. Call dater.getEvery(period, startDate, endDate, duration, blockAfter, refreshBoundaries).

  2. Choose a period from years, quarters, months, weeks, days, hours or minutes.

  3. Set the optional integer duration and before-or-after preference as needed.

Expected outcome

An array of results containing the requested date, block number and block timestamp for each interval point.

Guide limitations

  • If the date is before the first block, the library returns block 1; a future date resolves to the latest block.
  • The documented date inputs are values accepted by Moment.js, including strings, milliseconds, Date objects and Moment objects.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
12 October 2026
Original website title
monosux/ethereum-block-by-date · Official homepage title · retained in its source language