LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time String to Timestamp Conversion Problem

Solved!
Go to solution

Hi,

I attempted to convert time string to timestamp but I failed. What is the wrong with it? I need a timestamp to create waveforms.

Egemen
0 Kudos
Message 1 of 7
(3,562 Views)
Solution
Accepted by topic author newbieeng

Hi newbie,

 

use ScanFromString:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(3,548 Views)

You need to provide a date as well. Since you are only filling in the time the date is defaulting to all zeros which results in returng in the default time.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 7
(3,544 Views)

Thank you GerdW. It works well. Mark you are right. But in this case the date is not important for me. Thank you all.

Egemen
0 Kudos
Message 4 of 7
(3,519 Views)

I'm having trouble getting ms resolution of seconds into the timestamp.

 

string to stamp.png

 

This gives me tenths of seconds. How can I get down to ms?

(I tried "%3u" [error] and "%.3u" [no change] on the format string for Scan from String.)

 

Thanks,

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 7
(3,489 Views)

Hi Stevem,

 

%3u did not give error for me. check with the attached vi.

 

 

Best Regards,

Gogineni

 

Kudos are welcome

______________________________________________
Kudos are welcome
Message 6 of 7
(3,473 Views)

You are right Gogineni, when I got the error, I was using %S in the format string for Format Date/Time String function and %3u in the format string for Scan From String.

 

I found the solution in this thread - use %S%3u in both places.

 

 

string to stamp1.png

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 7
(3,463 Views)