Hi, The below image show me converting the time into a timestamp (and substituting the date from a different time stamp.
This works fine except for the miliseconds. you can see here the milliseconds are defines as "%2d" and this does not work. If I replace this with "%2u" or "%3u" then the VI will error (vi attached)
what am i doing wrong
Solved! Go to Solution.
OK, NEARLY! and Thanks 🙂
The problem now, is the number i am inputting is milliseconds, and the time stamp number is fractions of a second.
ie. "1" and "100" both translate to 00:00:00.100
anyone know how to translate this?
how would i make the time "00:00:00.001"
using this vi. if you set miliseconds to 1, the (and the time is set to say 12:30:15 (12hrs, 30min, 15sec) then you get 12:30:15:1.
What do i need to do to set the time to "12:30:15.001"
so not 0.1 but 0.001
It sounds like your formatting string is off. In the last part of the first string in TiTou's example, note that the string is .%03d rather than just .%d
This makes a big difference in the final result. I tried TiTou's code myself and entering 1 in the milliseconds produces .001 as expected.
so if it's 1 you want .100
so if it's 10 you want .010, right?
and if you have 100 what do you want? .001? if not, what would give you .001?
if you enter 1 you get .1
if you enter 10 you get .1
if you enter 100 you get .1
if you enter 5 you get .5
if you enter 15 you get .15
if you enter 150 you get .15
i cant see how you can get .005