6

Solidity provides the uint256 now or block.timestamp Special Variable.

How can I convert between this Solidity timestamp and year/month/day hour:minute:second?

1 Answer 1

5

Warning - Self Promotion

There are a few libraries that provide the functionality to perform the conversions between the timestamp and year/month/day hour:minute:second including:

And now there is @bokkypoobah's Gas-Efficient Solidity DateTime Library. More information about it in this medium post.

1
  • 1
    Nice contribution, but should probably add self promoting... Commented Sep 2, 2018 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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