0

I am learning Ethereum. During coding example, it mentioned time, for example, in javascript

const {time} = require("@nomicfoundation/hardhat-network-helpers");
let now_seconds = await time.latest();

In real world, there are some international atomic clocks to keep time. Does Ethereum relies on the off-chain clocks?

Thank you

oldpride
  • 131
  • 4

1 Answers1

1

Ethereum does not directly rely on off-chain clocks or international atomic clocks to keep track of time. Instead, it uses its internal mechanism called "block time" or "block timestamp" to maintain a consistent time reference across the network.

In your JavaScript example, the time.latest() function retrieves the timestamp of the latest Ethereum block. It does not directly interact with off-chain clocks or atomic clocks, but instead uses the on-chain time reference provided by the Ethereum network.

VX3
  • 646
  • 1
  • 11
  • thank you. With your lead, I also found a helpful post at https://ethereum.stackexchange.com/questions/18576 – oldpride Mar 29 '23 at 01:04