EXCEL2DT

Purpose:

Converts Excel timestamps to a datetime series.

Syntax:

EXCEL2DT(xldt)

(date, time) = EXCEL2DT(xldt)

xldt

-

A scalar or series of EXCEL format timestamps.

Returns:

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

 

(date, time) = EXCEL2DT(xldt) returns the date and time in two separate variables.

 

If the input is a scalar, the return value is a date/time string.

Example:

excel2dt(36161.1510)

 

Returns the string "1/01/1999 3:37:26.400".

Example:

W1: {36161.1510, 36270.1250, 36252.1752}

W2: excel2dt(W1)

 

W2 contains the datetime values:

 

 1/01/1999   3:37:26.400

 4/20/1999   3:00:00.000

 4/02/1999   4:12:17.280

Example:

W1: {36161.1510, 36270.1250, 36252.1752}

W2: excel2dt(w1)

W3: dt2excel(w2)

 

Same as above except W3 == W1, the original Excel timestamp values.

Example:

W1: {36161.1510, 36270.1250, 36252.1752}

W2: (d, t) = excel2dt(w1);ravel(d, t)

W3: dt2excel(w2)

 

Same as above except the date and time values are returned as two separate series.

Remarks:

An EXCEL timestamp is a real value that represents the number of days that have elapsed since 12/30/1899. The integer part is the whole number of days and the fractional part is the fraction of a 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 DT2EXCEL to convert a datetime series to Excel timestamps.

 

See DT2UNIX to convert a datetime series to Unix timestamps.

See Also:

DT2EXCEL

DT2UNIX

DT2YMDHMS

DTDURATION

DTPERIOD

GETDT

UNIX2DT