Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 44893

Questions related to the timestamp value of a block, or the use of Ethereum in timestamping.

1 vote

I want a function locked for a certain amount of time, what's the safest way to achieve this?

The two choices are to use time (or timestamp) and the block height. Block number is generally not advised, as the average block time is 15s. … Because of these bounds, using a timestamp in solidity is a much better choice. …
Shane Fontaine's user avatar
3 votes

best way to get transaction timestamps?

If you have the transaction information (which is the data you posted), you can use the blockNumber to look up the block information with getBlock() and find the timestamp of the block (which is also the … timestamp of the transaction). …
Shane Fontaine's user avatar
3 votes

How can i implement deadlines in smartContract?

require(now < 1549219795); // Where 1549219795 is the current unix timestamp. There are advantages for both. … With each mined block, miners include a timestamp of the current time. …
Shane Fontaine's user avatar
0 votes

How to get the actual time of occurrence for ethereum transaction in block

On Ethereum, the all transactions in a block are processed at the same time and given the same timestamp. This is the same as the timestamp of the block that it is included. … In order to get the timestamp of a specific transaction, simply look up the timestamp of the block that that transaction is included in. …
Shane Fontaine's user avatar
3 votes

Can the block number be set back in ganache?

The only option to do this is to use the takeSnapshot and revertToSnapshot functions in that same repo. When you are at a state you know you want to return to, call takeSnapshot in order to get a sna …
Shane Fontaine's user avatar
3 votes
Accepted

Timestamp in Ethereum

On the Ethereum blockchain, this is the only timestamp built into the protocol. The transaction you sent gets processed in the block that it is chosen in. …
Shane Fontaine's user avatar
1 vote
Accepted

Why does Solidity not use the years keyword?

Solidity had the year keyword in all versions prior to 0.5.0. It was removed due to complications and confusions about leap years. From the Time Units section of the docs: Take care if you perfor …
Shane Fontaine's user avatar