Skip to content

How to get a Date from a timestamp? #2159

Answered by ricmoo
DEGBEMBIA asked this question in Q&A
Discussion options

You must be logged in to vote

You should be able to use new Date(block.timestamp * 1000).

JavaScript uses milliseconds, Ethereum uses seconds, so you need to multiply by 1000.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DEGBEMBIA
Comment options

Answer selected by ricmoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants