DTGEN

The DTGEN procedure returns an IDLDT date/time array variable beginning with a specified date and incremented by a specified amount.

Calling Sequence

Result = DTGEN( Dt_start , Number )

Arguments

Dt_start

An IDLDT date/time variable that represents the starting date and time in the new data set.

Number

A numeric value specifying the number of date/time values to generate.

Keywords

DAY

Set this keyword to specify an increment in days.

HOUR

Set this keyword to specify an incrementin hours.

MINUTE

Set this keywork to specify an increment in minutes.

MONTH

Set this keyword to specify an increment in months.

SECOND

Set this keyword to aspecify an increment in seconds.

YEAR

Set this keyword to specify an increment in years.

Example

This example shows how to generate an array of date/time structures for consecutive years.

today = TODAY(); Create a date/time variable
containing the current date.

date = DTGEN( today , 4, /Year) ; Use DTGEN to create a new IDLDT date/time variable
containing 4 date/time values. The 4 IDLDT date/time values represent 4 consecutive years with identical months, days, and times.

PRINT, date

IDL prints:

{ 1998 4 3 12 35 39.0000 2450907.5 0}

{ 1999 4 3 12 35 39.0000 2451272.5 0}

{ 2000 4 3 12 35 39.0000 2451638.5 0}

{ 2001 4 3 12 35 39.0000 2452003.5 0}

See Also

VAR_TO_DT, IDLDT__DEFINE