TIME2HMS

Purpose:

Converts series of time values to hours, minutes and seconds.

Syntax:

TIME2HMS(time)

(hours, minutes, seconds) = TIME2HMS(time)

time

-

A scalar or series, the time (TOD) values.

Returns:

An Nx3 array of hours, minutes and seconds.

 

(hours, minutes, seconds) = TIME2HMS(time) returns the hours, minutes and seconds components in separate variables.

Example:

W1: time2hms(43200)

 

W1 == {{12, 0, 0}}, a 1x3 series representing 12 hours, 0 minutes and 0 seconds.

Example:

W2: time2hms(todstr("12:00:00"))

 

Same as above, except the time value is entered as a string to the TODSTR function.

Example:

(h, m, s) = time2hms(todstr("12:00:00"))

 

Same as above, except the time components are returned in three separate series variables.

h == {12}

m == {0}

s == {0}

Example:

W1: hms2time({10, 12, 14}, {30, 40, 50}, {1, 2, 3})

W2: time2hms(w1)

 

W1 contains the time values:

10:30:01

12:40:02

14:50:03

 

W2 converts the time values in W1 to individual time components replicating the input values of W1.

W2 == {{10, 30, 1},

       {12, 40, 2},

       {14, 50, 3}}

Remarks:

TIME2HMS creates a time component series by converting individual time of days values to hour, minutes and seconds values.

 

A time of day or TOD value is the number of seconds since midnight.

 

See HMS2TIME to create time of days values from hours, minutes and seconds values.

See Also:

DATE2YMD

HMS2TIME

STRTOD

STRTODMSEC