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?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communitySolidity 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.