I was unable to find any relevant documentation for the now keyword within the Solidity documentation, other than its usage in examples. What exactly does the now keyword return, how is it determined and what are the associated gas costs? I assume it is similar to Unix time.


1 Answer 1


In short now is just an alias for block.timestamp and it is the number of seconds since the Epoch as per documentation.

Beware that this value is set by miners so there is a little potential for a malicious manipulation but general nodes are meant to coordinate.

  • 3
    Update: Solidity 0.7.0 deprecated the now keyword. For contracts ^0.7.0, you must use block.timestamp. Jul 1, 2020 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.