Skip to content
On this page


SmartPy's type for timestamps is sp.timestamp. It corresponds to the timestamp type in Michelson.

There are two ways to specify a literal timestamp:

  • sp.timestamp(n) refers to the moment in time n seconds since the Epoch. For example, sp.timestamp(1571659294) represents 2019-10-21T12:01:34Z.

  • sp.timestamp_from_utc(year, month, day, hours, minutes, seconds) represents the given time in UTC. For example sp.timestamp_from_utc(2021, 12, 31, 23, 59, 59) corresponds to 2021-12-31T23:59:59Z.  → 

The current block timestamp, a.k.a. the "minimal injection time". For a detailed explanation see Michelson's NOW instruction.

sp.add_seconds(t: sp.timestamp, secs: → sp.timestamp

Adds secs seconds to t.

sp.add_days(t: sp.timestamp, days: → sp.timestamp

Adds days days to t.