UNIX2DT

Purpose:

Converts Unix timestamps to a datetime series.

Syntax:

UNIX2DT(ut, offset, "startdate")

(date, time) = UNIX2DT(ut, offset, "startdate")

ut

-

A series of Unix format time stamps.

offset

-

Optional. A real, the time offset in seconds. Defaults to 0.0.

"startdate"

-

Optional. A string, the starting date. Defaults to "1/01/1970".

Returns:

A datetime series where the data and time values are in two adjacent columns.

 

(date, time) = UNIX2DT(ut, offset, "startdate") returns the date and time in two separate variables.

Example:

W1: {1407159000, 1408159082, 1411150163, 1417159180, 1427159240}

W2: unix2dt(W1)

 

W2 contains the datetime series:

 

 8/04/2014  13:30:00

 8/16/2014   3:18:02

 9/19/2014  18:09:23

11/28/2014   7:19:40

 3/24/2015   1:07:20

Example:

W3: {1407159000, 1408159082, 1411150163, 1417159180, 1427159240}

W4: (d, t) = unix2dt(W3); ravel(d, t)

 

W4 contains the datetime series:

 

 8/04/2014  13:30:00

 8/16/2014   3:18:02

 9/19/2014  18:09:23

11/28/2014   7:19:40

 3/24/2015   1:07:20

Remarks:

Unix timestamps are generally in seconds elapsed since midnight January 1, 1970 UTC time. UNIX2DT converts the Unix second values into date and clock time for the day.

 

A datetime series consists of 2 columns of values where the first column contains integer Julian dates starting at midnight and the second column contains time in seconds starting from midnight.

 

See DT2UNIX to convert a datetime series to Unix timestamps.

See Also:

DT2EXCEL

DT2TIMESTAMP

DT2UNIX

DT2YMDHMS

DTDURATION

DTPERIOD

GETDT

TIMESTAMP2DT