-
Notifications
You must be signed in to change notification settings - Fork 705
Closed
Description
block-time
is a new Clarity keyword that returns the timestamp of the current
block in seconds since the Unix epoch. This is the same timestamp that is in the
block header, which is verified by the signers to be:
- Greater than the timestamp of its parent block
- At most 15 seconds into the future
This same timestamp can also be retrieved for previous blocks using
(get-stacks-block-info? time height)
, which exists since Clarity 3, but cannot
be used for the current block.
- Output:
uint
- Example:
(if (> block-time 1755820800) (print "after 2025-07-22") (print "before 2025-07-22"))
hugoclrd
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status: ✅ Done