IDLDT__DEFINE

The IDLDT__DEFINE procedure (note the double underscore) is invoked automatically by IDL when one of the date/time routines--listed below in " See Also "--references the named structure, IDLDT. IDLDT__DEFINE also automatically creates a number of related system variables, initializing them to their default values.

The IDLDT structure includes the following fields:

** Structure IDLDT, 8 tags, length=32:

YEAR INT 0

MONTH BYTE     0

DAY BYTE     0

HOUR BYTE     0

MINUTE BYTE     0

SECOND FLOAT  0.00000

JULIAN DOUBLE 0.0000000

RECALC BYTE     0

For more information, see Automatic Structure Definition .

System Variables set by IDLDT__DEFINE

!DT_BASE

The base date for calculations. !DT_BASE is an IDLDT structure initially set to
{IDLDT, -4713, 1, 1, 12, 0, 0, 0.d, 0}.

!DATE_SEPARATOR

A character used as a separator for string dates. The default value is " / ".

!TIME_SEPARATOR

A character used as a separator for string clock times. The default value is " : ".

!HOLIDAYS

A 50 element array indicating holidays, for exclusion from certain calculations. No holidays are installed by default.

!WEEKEND_LIST

A byte array indicating which days of the week are weekend days, to be excluded from certain calculations. No weekends are defined by default,
e.g. !WEEKEND_LIST = byte([0, 0, 0, 0, 0, 0, 0])

!DAY_NAMES

An array of strings, giving the names of the days of the week:
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]

!MONTH_NAMES

An array of strings, giving the names of the months:
["January", "February", "March", "April", "May", $
  "June", "July", "August", "September", $
  "October", "November", "December" ]

Calling Sequence

IDLDT__DEFINE

Example

The IDLDT structure is created and initialized by calling IDLDT__DEFINE. Many of the date and time routines automatically invoke IDLDT__DEFINE when you call them.

For more information about structures, see Structures .

day = TODAY() ; Return the current date and time (using the TODAY function) in an IDLDT structure named day ; .

print, day

IDL prints:

{ 1998 3 6 15 6 27.0000 2450879.6 0}

HELP, day, /STRUCTURE ; ;Show how each field of the variable day; is defined.

IDL prints:

** Structure IDLDT, 8 tags, length=32:

YEAR INT   1998

MONTH BYTE       3

DAY BYTE       6

HOUR BYTE       15

MINUTE BYTE       6

SECOND FLOAT             27.0000

JULIAN DOUBLE       2450879.6

RECALC BYTE       0

HELP, {IDLDT}, /STRUCTURE ; Show how each field of IDLDT is initialized.

IDL prints:

** Structure IDLDT, 8 tags, length=32:

YEAR INT          0

MONTH BYTE 0

DAY BYTE 0

HOUR BYTE 0

MINUTE BYTE 0

SECOND FLOAT        0.00000

JULIAN DOUBLE       0.0000000

RECALC BYTE 0

empty = {IDLDT} ; Create an empty date variable.

print, empty

IDL prints:

{ 0 0 0 0 0 0.00000 0.0000000 0}

See Also

DAY_NAME , DAY_OF_WEEK , DAY_OF_YEAR , DT_ADD , DT_SUBTRACT , DT_TO_VAR , JUL_TO_DT , SEC_TO_DT , STR_TO_DT , TODAY , VAR_TO_DT .