This is a feature I recently added in Glulx, but it isn't necessarily available in all interpreters yet.
One extension is
http://inform7.com/extensions/Ron%20New ... index.html...but it looks like that doesn't do exactly what you want.
This would work, mostly:
Code:
To decide if the player's timestamp is available: (- (glk($0004, 20, 0) ~= 0) -).
To decide what number is the player's timestamp: (- glk($0161, 1) -).
Instead of jumping:
unless the player's timestamp is available:
instead say "Not available.";
let N be the player's timestamp;
say "It is [N]."
You can grab the player's timestamp at any point (say, every turn) and subtract for the difference.
The only catch is that the value is a 32-bit number, so it'll overflow sometime in the year 2106. If someone is playing your game on that day, the timer will go wrong once.