LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to build a time stamp from a string

I have the date-time information stored in a string and I want to build a time stamp to make a plot with the date-time in the X axys. Is there a way to do this??
 
thanking in advance...
 
crimolvic
0 Kudos
Message 1 of 6
(3,519 Views)
See attached vi.  You may have to modify depending on the order your string.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 6
(3,507 Views)
You can also look at this VI to see an example of how this can be done on varying patterns (it may have bugs).
To have the time displayed, you should have the X axis represented as actual time (right click>>Format & Precision).
Also, I suggest you go to the top of this page, click Support and make a product suggestion for a VI like this (the opposite of Date\Time to String).

___________________
Try to take over the world!
0 Kudos
Message 3 of 6
(3,502 Views)
Here is a better version of that VI.

___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(3,493 Views)
Hi tst, I have seen your latest attached as above but I am not sure what to put.  Can you give me an example of inputs?

Clement
0 Kudos
Message 5 of 6
(3,127 Views)

If you are using 8.x, you should use the Scan from String primitive, which can also process time format codes. The codes are documented in the help for the time functions and an easy way of generating them is going into the properties of a numeric control, going to the format page, selecting a time format and then changing the display to advanced.

If you aren't using 8.x, this VI uses the same time format codes, but you should note that it is not a fully debugged and planned VI.

A simple example for scanning "11/02/2008 21:34" is "%d/%m/%Y %H:%M".


___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(3,115 Views)