That description is incorrect. There is no way to access the current time or height from within the Script language.
Instead, there is a level of indirection:
- A transactions nLockTime or nSequence enforces an absolute or relative locktime on the transaction.
- The
OP_CHECKLOCKTIMEVERIFYandOP_SEQUENCEVERIFYopcodes inside script compare the top stack element with the transaction’s nLockTime or nSequence value.
Functionally, together these constructions do let you effectively write scripts that can enforce time constraints. E.g. a script using OP_CHECKLOCKTIMEVERIFY can require the nLockTime of the spending transaction to be at least N, and thereby indirectly force the transaction to not be minable until N has passed.
The advantage of this split is that transaction script validity is a single boolean value that only needs to be verified once: a transaction’s script validity is either always valid or always invalid.











