Converts date/time variables to string data.
times (optional) A variable containing the time strings extracted from date/time variable.
Value | Format Description | Examples for May 1, 1992 |
---|---|---|
1 | MM*DD*YYYY | 05/01/1992 |
2 | DD*MM*YYYY | 01-05-1992 |
3 | ddd*YYYY | 122,1992 |
4 | DD*mmm[mmmmmm]*YYYY | 01/May/1992 |
5 | YYYY*MM*DD | 1992-05-01 |
Time_Fmt Specifies the format of the time portion of the data in the input variable. Possible values are -1 or -2, as summarized in the following table:
Value | Format Description | Examples for 1:30 p.m. |
---|---|---|
-1 | HH*Mn*SS.sss | 13:30:35.25 |
-2 | HHMn | 1330 |
Date and time separators are specified with the !Date_Separator and !Time_Separator system variables. It is possible to use any character or string as a separator with the DT_TO_STR function; however, if you use a non-standard separator (one other than dash (-), slash (/), comma (,), period (.), or colon (:)), you will be unable to convert the data back to a date/time variable with STR_TO_DT. If Either of these system variables is set to an empty string, then you receive a default separator.
You must specify a date and/or time format if the dates and/or times parameters are specified.
date1
that contains the following date/time structures:
date1=[{!dt, $ 1992,3,13,1,10,34.0000,87474.049,0}, $ {!dt, 1983,4,20,16,18,30.0000,84224.680,0}, $ {!dt, 1964,4,24,5,7,25.0000,77289.213,0}]
DT_TO_STR, date1, d, t, Date_Fmt=1, $ Time_Fmt=-1
PRINT, d
3/13/1992 4/20/1983 4/24/1964
PRINT, t
01:10:34 16:18:30 05:07:25
System Variables: !Date_Separator, !Time_Separator
For more information on date/time, see the PV-WAVE User's Guide.