I deployed a smartpy contract in florencenet via smartpy.io. The command sp.timestamp_from_utc_now() used inside the program seems to be not giving the current time. Instead it is giving the same time the contract is deployed. How do I get the current time/timestamp in smartpy?
sp.timestamp_from_utc_now() is a helper function that only works at compilation time, meaning that it produces a constant and doesn't update at runtime.
timestamp_from_utc_now() should be moved to
sp.utils soon, which should avoid confusion.
You want to use the instruction sp.now which gives the current block timestamp.