0

pile memory pile = pile(msg.sender,location,style,availabletime,ISBN,intro,cover,status,price,now,0,0); in this sentence, what keywords i should take to replace now

yao yu
  • 11
  • 2

1 Answers1

1

now was an alias block.timestamp keyword.

From contracts with solidity version equal or greater than ^0.7.0 you can replace it with the keyword:

block.timestamp

More information here.

Antonio Carito
  • 2,445
  • 3
  • 10
  • 23
  • In fact, now was deprecated and shouldn't be used anymore. – Lauri Peltonen Apr 11 '22 at 11:13
  • if i change like this: pile memory pile = pile(msg.sender,location,style,availabletime,ISBN,intro,cover,status,price,block.timestamp,0,0); TypeError: Struct containing a(nested) mapping cannot beconstructed. what can i do – yao yu Apr 11 '22 at 15:48