That description is incorrect. There is no way to access the current time or height within the scripting language.
Instead, there is an indirect level:
- Transaction nLockTime or nSequence applies an absolute or relative lock time to a transaction.
- that much
OP_CHECKLOCKTIMEVERIFY
andOP_SEQUENCEVERIFY
The opcode inside the script compares the top stack element to the transaction’s nLockTime or nSequence value.
Functionally, these constructs together allow you to effectively write scripts that can enforce time constraints. For example a script using: OP_CHECKLOCKTIMEVERIFY
You can require that a spending transaction’s nLockTime be at least N, thereby indirectly forcing the transaction not to be mined until N has passed.
The advantage of this split is that the transaction script validity is a single Boolean value that only needs to be checked once. The script validity of a transaction is either always valid or always invalid.