Element | Data Type | Valid Range |
---|---|---|
!DT.Year | integer | 0 to 9999 |
!DT.Month | byte | 1 to 12 |
!DT.Day | byte | 1 to 31 |
!DT.Hour | byte | 0 to 23 |
!DT.Minute | byte | 0 to 59 |
!DT.Second | floating point | 0.0000 to 59.9999 |
!DT.Julian | double precision | The number of days calculated from September 14, 1752. The decimal part contains the time as a fraction of a day. |
!DT.Recalc | byte | Recalculation flag: setting this flag to 1 forces the julian day to be recalculated. |
date = {!dt, 1992,4,27,7,45,40.0,87519.323,0}
PRINT, date
; PV-WAVE prints: { 1992 4 27 7 45 40.0000 87519.323 0}
date = {!dt, 1992, 4, 27, 7, 45, 40.0, 87519.323, 0}
date.day = 30
PRINT, date
; PV-WAVE prints: { 1992 4 30 7 45 40.0000 87519.323 0}
date.recalc = 1
note | Rather than modifying a date/time variable by assigning a new value to one of its elements, you should use the DT_ADD and DT_SUBTRACT functions to create new variables. If you use these functions, the Julian day is automatically recalculated. |
!DT_BASE = {!DT}
CREATE_WEEKENDS, ['Saturday', 'Sunday']
day1 = VAR_TO_DT(2015, 1, 1)
dt_array = DTGEN(day1, 366)
Julian_day = DT_COMPRESS(dt_array, /SETTOZERO)
result = JUL_TO_DT(Julian_day)
; Creates a date/time structure filled with zeros.
date = {!DT}
PRINT, date
; PV-WAVE prints: { 0 0 0 0 0 0.00000 0.0000000 0}
; Creates 3 structures filled with zeros.
date1 = REPLICATE({!DT}, 3)
PRINT, date1
; PV-WAVE prints the following:
; { 0 0 0 0 0 0.00000 0.0000000 0}
; { 0 0 0 0 0 0.00000 0.0000000 0}
; { 0 0 0 0 0 0.00000 0.0000000 0}
note | When you use the DC_READ functions with the DT_Template keyword to import and convert data, you must use this REPLICATE method to create an “empty” array variable containing date/time structures. Once you have created this array variable, you can read date/time data from a file into the variable. See "Creating Plots with Date/Time Data" for examples. |