TIMEPERIOD

Purpose:

Calculates the difference of time series in hours, minutes and seconds.

Syntax:

TIMEPERIOD(time1, time2)

(h, m, s) = TIMEPERIOD(time1, time2)

date1

-

A series of Julian integer dates, the end dates.

date2

-

Optional. A series of Julian integer dates, the start dates. Defaults to an empty series.

Returns:

The elapsed period as an N x 3 series of hours, minutes, seconds.

 

(h, m, s) = TIMEPERIOD(time1, time) returns the values in separate variables.

 

If only one time series is specified, the periods are computed on the two-point difference of each time value.

Example:

W1: hms2time(10, 11, 12)

W2: hms2time(20, 30, 40)

W3: timeperiod(w2, w1)

W4: timeoffset(w1, w3)

 

W1 contains the time:

 

10:11:12

 

W2 contains the date:

 

20:30:40

 

W3 computes difference between the two time series in hours, minutes and seconds. The period is 10 hours, 19 minutes and 28 seconds.

 

W4 reconstructs W2's end time by adding W3's offset to W1's start time.

Example:

W1: hms2time(10, 11, 12)

W2: hms2time(20, 30, 40)

W3: timeperiod(w1, w2)

W4: timeoffset(w2, w3)

 

Same as the first example except the start and end times are swapped. The result is a negative period, -10 hours, -19 minutes and -28 seconds.

 

W4 reconstructs W1's end time by adding W3's negative offset to W2's start time.

Example:

W1: gnorm(10, 1.005)

W2: col(getdt(w1), 2)

W3: timeperiod(w2)

W4: hms2time(w3)

 

W1 contains 10 random samples with a time spacing of 1.005 seconds between samples.

 

W2 computes the time values for each sample in W1.

 

Because only one time series input was given, W3 computes the two-point time difference between subsequent samples of W2. The result is 0 hours, 0 minutes and 1.005 seconds for each sample, equal to the original sample spacing of the series in W1.

 

W4 displays the time differences contained in W3 in wall clock format.

Remarks:

TIMEPERIOD computes the difference between two time series with the result in periods of hours, minutes and seconds.

 

If only one time series is provided, the two-point period difference between subsequent time values is computed.

 

A date period is measured in years, months and days.

 

A date duration is measured in seconds.

 

See TIMEDURATION to compute the time difference in seconds.

See Also:

DATE2YMD

DATEDURATION

DATEOFFSET

DATEPERIOD

DTDIFF

DTDURATION

DTOFFSET

DTPERIOD

TIME2HMS

TIMEDURATION

TIMEOFFSET