Date Operators
Ago, Hence, From Now
Behavior: The ago and hence operators produce a date/time value that is the specified length of time in the past or future, respectively. Note that from now can be used as a synonym for hence.
Syntax:
timeInterval ago
timeInterval hence
Syntax definitions for language elements follow these formatting guidelines:
- boldface: Indicates words and characters that must be typed exactly
- italic: Indicates expressions or other variable elements
- {} (curly braces): Indicate optional elements.
- [] (square brackets) separated by | (vertical pipes): Indicate alternative options where one or the other can be used, but not both.
Example syntax:
In this example, "open file" is required and must be typed exactly. "fileName" is a variable element; it is the path to and name of the file being opened. The following expression is optional and indicates why the file is being opened. If this expression is added, "for" is required and must be typed exactly. One of the following must be included, but only one, and they also must be typed exactly: "reading", "writing", "readwrite", "appending", or "updating".
TimeInterval is typically given as a time interval value (see Time Intervals in Values). However, it can actually be any value or an expression in parentheses that yields a number, which will be treated as the number of seconds. The ago operator results in a time value that is the indicated length of time earlier than the present moment (in the past). The hence operator yields a time value that is the indicated length of time later than the present moment (in the future). The resulting value is set to use the Abbreviated International Time format when it is converted to text.
Example:
put three minutes hence into expirationTime
Example:
if modificationDate of file updateLog is earlier than 5 days ago then ...