GETDT

Purpose:

Returns the date and time values of a series.

Syntax:

GETDT(series, utc)

(date, time, y) = GETDT(series, utc)

 

series

-

An interval or XY series. If not specified, defaults to the current date and time.

utc

-

Optional. An integer, the UTC date/time flag.

0

:

use local date/time (default)

1

:

use UTC date/time

Returns:

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

 

(date, time, y) = GETDT(series) returns the date, time and Y values as separate series.

Example:

W1: getdt()

 

Returns a 1x2 datetime series with the current date and time.

Example:

W2: getdt(1)

 

Returns a 1x2 datetime series with the current date and time in UTC.

Example:

W1: {julstr("1/1/99"), julstr("1/10/99"), julstr("4/2/99")}

W2: {todstr("12:00"), todstr("14:00"), todstr("9:35")}

W3: {1, 2, .5};setvunits("V")

W4: xydt(w1, w2, w3)

W5: getdt(w4)

 

W5 contains the datetime series:

 

1/01/1999,  12:00:00.000

1/10/1999,  14:00:00.000

4/02/1999,  09:35:00.000

Example:

W1: {ymd2date(1999, 1, 1), ymd2date(1999, 1, 10), ymd2date(1999, 4, 2)}

W2: {hms2time(12, 0, 0), hms2time(14, 0, 0), hms2time(9, 35, 0)}

W3: {1, 2, .5};setvunits("V")

W4: xydt(w1, w2, w3)

W5: getdt(w4)

 

Same as above, except the input dates are given in YMD format and the input times are given in HMS format.

Example:

W1: {ymd2date(1999, 1, 1), ymd2date(1999, 1, 10), ymd2date(1999, 4, 2)}

W2: {hms2time(12, 0, 0), hms2time(14, 0, 0), hms2time(9, 35, 0)}

W3: {1, 2, .5};setvunits("V")

W4: xydt(w1, w2, w3)

W5: getdt(w4, 1)

 

Same as above, except the returned date/time values are in UTC time.

Remarks:

GETDT breaks out the date and time values from any series and returns a datetime series.

 

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.

 

The time values returned by GETDT are in real time format and include fractional seconds, with precision specified by the TIME_PRECISION configuration parameter.

 

The series date and time values are always saved in local date/time. If UTC is 1, the returned date/time values are in UTC date/time.

 

The plot style is set to table view.

 

See DTXY for a similar function to return the date, time and Y values from a series.

 

See XYDT to produce an XY series from separate date, time and y value series.

See Also:

DTXY

GETDATE

GETTIME

JULSTR

TODSTR

XY

XYDT

YMDHMS2DT