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?


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
    Nice contribution, but should probably add self promoting... – goodvibration Sep 2 '18 at 11:57

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.