Is the block.timestamp value in Solidity seconds or milliseconds?
I'm looking to use
block.timestampin one of my contracts and I want to know whether the
block.timestampis seconds like in Python or milliseconds like in Java or some other value?
Also, is it safe to use
block.timestampto check if 30 days is past since the last updated time or something like that?
The `blocks.timestamp` is a Unix time stamp. So, it has the complete information about the date, hours, minutes, and seconds (in UTC) when the block was created.
I thank you for your response. I very much appreciate it and for providing more details and clarifications.
Please also see this post on the same subject: https://ethereum.stackexchange.com/questions/68064/what-is-the-time-zone-of-the-ethereum-block-chain/68065
... timestamp of the current block in seconds since the epoch
For your other question:
Also, is it safe to use block.timestamp to check if 30 days is past since the last updated time or something like that?
Your question isn't completely clear, but assuming you're questioning the validity of a timestamp over a given period of time, then this previous answer should cover it: Is block.timestamp safe for longer time periods?
Thanks for pointing out the documentation. I some how missed it it is seconds. Let's say I set a timestamp value: lastUpdated in a previous block. In a future block, I check if the lastUpdated is past 30 days or not to do some action. Would this be a safe check? Assuming that the difference in time difference is reasonable(order of days) and not too close?