Inform 7 Home Page / Documentation
§9.9. Comparing and shifting times
Carrying out easy calculations with times is straightforward:
The chronometer is in the Clock Chamber. "On one wall is a terribly self-important chronometer showing the time in major world cities. London: [time of day]. Paris: [one hour after the time of day]. Tokyo: [9 hours after the time of day]. Cupertino, California: [7 hours before the time of day]."
Here we are using two phrases:
(time) before (time) ... time
This phrase produces a time earlier by the amount given, keeping within the 24 hour clock. Example:
produces 10:30 PM.
(time) after (time) ... time
This phrase produces a time later by the amount given, keeping within the 24 hour clock. Example:
produces 8 PM.
Similarly, we have conditions:
if (time) is before (time):
This condition is true if the first time occurs earlier in the day than the second. In recognition of the fact that very few stories begin before 4 AM, whereas many run on past midnight, the start of the day is taken to be 4 AM: thus 3:59 M is after 11:10 PM, but 4:04 AM is before it.
if (time) is after (time):
This condition is true if the first time occurs later in the day than the second. In recognition of the fact that very few stories begin before 4 AM, whereas many run on past midnight, the start of the day is taken to be 4 AM: thus 3:59 M is after 11:10 PM, but 4:04 AM is before it.