The DT_TO_VAR procedure converts a date/time variable to numerical data.
Assume the date/time variable date1 contains the following date/time data:
{IDLDT, 1971,6,23,15,52,15.000,87474.440,0}, $
{IDLDT, 1970,9,4,10,30,19.000,84224.521,0}, $
{IDLDT, 1969,10,8,4,25,14.000,77350.684,0}, $
{IDLDT, 1977,6,18,10,42,19.000,84224.521,0}]
To extract each date/time element into a separate variable, enter:
DT_TO_VAR, date1, YEAR=years, MONTH=months, DAY=days
years;
is an integer variable, while
months;
and
days;
are byte
variables.
VAR_TO_DT, IDLDT__DEFINE