Colloquial speech has many temporal conventions that would be very hard to mimic in a programming language. For example, somebody's age can be expressed in years (for an adult) or in weeks (for a baby). To allow unambiguous temporal expressions, Rax provides four different temporal data types: time, absolute (duration), relative (duration) and interval. In Rax, the aforementioned ages would be values of a different type. Temporal types in Rax not only make it easier to read and interpret Rax code, they also allow detection of erroneous or suspicious operations. For example, multiplying two points in time generates a runtime error.
The time type in Rax represents an exact moment
in time, like the 20^{th} of March of the year 2012 at three
minutes and sixteen seconds past noon.
Actually, the granularity of time in Rax is 1/10.000^{th} of a
second.
The time type is denoted by the @
symbol in Rax.
Temporal data is most often read from a file but it is quite possible to use the ISO
8601 temporal representation^{[9]}. Also the word "now"
can be used to get a valid temporal value. For example, like so:
@: now := (@)"now"; @: touchdown'UK := (@)"19660820T12:33:1502";
Note the (@)
operator that casts a string value to a time value.
Some languages have separate date
and time
types. This is more in line with
the context dependent way temporal information is
used in colloquial speech where a date can stand for an interval of 24
hours ("I'll fix that tomorrow."), the very start of a day ("On my desk
before tomorrow."), and so on.
The Rax time type is more like the datetime
type
found in some SQL dialects. There are, however, no variations
like smalldatetime
, or parametrized "families" of
types like datetime2(<num>)
,
or datetimeoffset(<num>)
.
The table below lists the operators defined on @
.
Table 4.1. Operators defined on @
Syntax  Explanation 

t1 := t2  Assignment 
t1 == t2  Equals 
t1 != t2  Not equals 
t1 < t2  Less than. Returns true ,
if t1 represents
an earlier point in time
than t2 .

t1 > t2  Greater than. Returns true ,
if t1 represents
a later point in time
than t2 .

t1 <= t2  Less than or equal
to. Returns true ,
if t1 represents
an earlier or the
same point in time as t2 .

t1 >= t2  Greater than or equal
to. Returns true ,
if t1 represents
a later or the
same point in time as t2 .

t1 ^ t2  Absolute difference. Returns
an absolute that represents the duration
of the interval starting at t1 and ending
at t2 . For example:
(@)"20140911" ^ (@)"20140903" == (^)"P1W1D" .

t1 ~ t2  Relative difference. Returns
a relative that represents the duration of
the interval starting at t1 and ending
at t2 . For
example: (@)"20140911" ~ (@)"20140811" ==
(~)"P1M" .

t + ad  Addition, ad is of
type ^ . Returns a point in time resulting
from shifting t forward by the absolute
duration ad . For example:
(@)"20140911" + (^)"1W2D" == (@)"20140919" .

t + rd  Addition, rd is of
type ~ . Returns a point in time resulting
from shifting t forward by the relative
duration rd . For example:
(@)"20140911" + (~)"1Y1M" == (@)"20151011" .

t  ad  Subtraction, ad is of
type ^ . Returns a point in time resulting
from shifting t backwards by the absolute
duration ad . For example:
(@)"20140911"  (^)"1W2D" == (@)"20140902" .

t  rd  Subtraction, rd is of
type ~ . Returns a point in time resulting
from shifting t backwards by the relative
duration rd . For example:
(@)"20140911"  (~)"1Y1M" == (@)"20130811" .

t <: i  Element of, i is of
type  . Returns true ,
if the point in time t is an element of
the interval i . For example:
(@)"20140913" <: ()"20140911/P1W" is
true.

i :> t  Contains, i is of
type  . Returns true ,
if the interval i contains the point in
time t . For
example: ()"20140911/P1W" :>
(@)"20140913" .

^{[9] }Please note that the ISO 8601 standard does not support Nautical time zone suffixes other that 'Z' (for Zulu or UTC). It does, however, support explicit offsets like "+11:30")