PDA

View Full Version : DT_TO_STR without subseconds



hcrisp
02-04-2011, 04:23 PM
I am trying to convert a Date variable to a time string leaving off the subseconds. The DT_TO_STR help shows this:



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
; PV-WAVE prints: 01:10:34 16:18:30 05:07:25


However, my code (9.01f on Win XP) gives this:



; 01:10:34.000 16:18:30.000 05:07:25.000

hcrisp
02-09-2011, 08:48 AM
Can someone from VNI confirm whether the DT_TO_STR is wrong or not? I can do string parsing as a work-around, but if there is an elegant way to do it like the Help shows, I would rather do that.

acg
02-10-2011, 05:17 PM
The output you are seeing is correct.
The DT_TO_STR routine only accepts two time formats:

-1: HH*Mn*SS.sss
-2: HHMn