-
Hello, how to get the smart contract timestamp as a date in the javascript frontend? |
Beta Was this translation helpful? Give feedback.
Answered by
ricmoo
Oct 10, 2021
Replies: 1 comment 1 reply
-
You should be able to use JavaScript uses milliseconds, Ethereum uses seconds, so you need to multiply by 1000. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ricmoo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should be able to use
new Date(block.timestamp * 1000)
.JavaScript uses milliseconds, Ethereum uses seconds, so you need to multiply by 1000.