Index

Interval

A time interval.

Input Format:

This is a sexagesimal style format, with suffixes after each component to allow one to enter just the components that meet your requirements. The following are a few examples of valid intervals, followed by their meanings:
  23d:14h:16m:2.32s   ->  23 days, 14 hours , 16 minutes, 2.32 seconds.
  15.5m               ->  15 minutes, 30 seconds..
  100h                ->  110.h hours.
  4m:2.5s             ->  4 minutes, 2.5 seconds.
 -2h                  ->  -2 hours (negative intervals are mainly used for
                                    specifying do-loop increments).
Any of the components can be omitted, but they must appear in order of decreasing significance.

The first of the chosen components can have a sign, and the last component can have a fractional part.

Note that it is an error for the value of one component to exceed one unit of the component that precedes it. Thus 23d:300m is ok because there are more than 300 minutes in a day, but 23d:4h:300m isn't, because an hour component has been provided and 300 minutes exceeds the number of minutes in an hour.

Use with do-loops:
When an Interval variable is used as the dependent variable of a do-loop, the associated loop increment is also specified as an Interval.

Example 1:
The following three lines are equivalent. Each prints the value 23h:30m:27.0s.
 print $Interval(23.5075h)

 print $Interval(23h:30.45m)

 print $Interval(23h:30m:27s)
Example 2:
The following example halts script execution for 1.5 hours.
 until $elapsed >= 1h:30m
Example 3:
The following example would show the position of the source 3c286 in two and a half days time.
 show 3c286, utc=$date + 2.5d
or equivalently:
 show 3c286, utc=$date + 2d:12h

Context:
There are two common uses of time intervals. They are used in Date expressions to add or subtract from a given date and time. They are also used by the elapsed() function to specify how long the function should return false after entering its enclosing loop or until statement.

Martin Shepherd (24-Oct-1999)