Standard Library function that converts a date/time variable to a double-precision variable containing the number of seconds elapsed from a base date.
Date_Fmt Specifies the format of the base date, if passed into the function. Possible values are 1, 2, 3, 4, or 5, as summarized in the following table:
Value | Format Description | Examples for May 1, 1992 |
---|---|---|
1 | MM*DD*[YY]YY | 05/01/92 |
2 | DD*MM*[YY]YY | 01-05-92 |
3 | ddd*[YY]YY] | 122,1992 |
4 | DD*mmm[mmmmmm]*[YY]YY | 01/May/92 |
5 | [YY]YY*MM*DD | 1992-05-01 |
For a detailed description of these formats, see the PV-WAVE User's Guide.
date1
that contains the following date/time data:
date1=[{!dt, $ 1992,3,27,7,18,57.0000,87488.305,0},$ {!dt, 1993,3,27,7,18,57.0000,87853.305,0}, $ {!dt, 1994,3,27,7,18,57.0000,87218.305,0}]
seconds = DT_TO_SEC(date1) PRINT, seconds
7.5589031e+09 7.5904391e+09 7.5355751e+09
date1
that contains the following date/time data:
date1=[{!dt, $ 1992,4,15,7,29,19.0000,87507.312,0},$ {!dt, 1993,4,15,7,29,19.0000,87872.312,0}, $ {!dt, 1994,4,15,7,29,19.0000,88237.312,0}]
seconds = DT_TO_SEC(date1, $
Base='1-1-70', Date_Fmt=1)
PRINT, seconds
7.0332296e+08 7.3485896e+08 7.6639496e+08