LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time/date string to timestamp

Solved!
Go to solution

Hi,

I want to convert date/time in string format  to timestamp format (Using Labview 7.0). For this i m using scan from string tool and wired the format string but its not able to connect the output. I have attached the vi.

 

Kindly help me to correct the error 

 

Regards,

Ratna

0 Kudos
Message 1 of 27
(7,661 Views)

Can you save the VI with some typcial data set as default in the array?

Technically it should work if your strings are in the right format (HH:MM, dd/mm/yy).

 

 

0 Kudos
Message 2 of 27
(7,655 Views)

Hi,

 

This is happening as you are wiring the wrong values into the concatenate string function. Check the image. Make the first element from index(0,0) and second element index(0,1). Then it will work as you want.


exmo.png
Regards,

Nitzz 

(Give Kudos to good Answers and Mark it as a Solution if your problem is Solved;))

0 Kudos
Message 3 of 27
(7,654 Views)

hi,

 

 I tried the same but still its not working. Plz......:womansad:.. help me or give me other idea to convert date time string to timestamp format.

 

 

Regards,

Ratna

0 Kudos
Message 4 of 27
(7,639 Views)

Your VI still does not contain any default data. Without knowing how your strings are formatted we're pretty much fishing in the dark.

Make sure the array has some typical data in it, then go to Edit > Make current values default. Then save the VI.

 

0 Kudos
Message 5 of 27
(7,636 Views)

hi,

 

sorry earlier i forgot to do that.

 

 

0 Kudos
Message 6 of 27
(7,632 Views)

I don't know how Nitzz had this idea of changing the indices without seeing any data, change the array indices back to the initial values, they were correct.

I get the correct time stamp. Of course you're only reading the first element, you'd have to put all in a for loop to get an array of timestamps if this is what you expect.

DT-Str.png

0 Kudos
Message 7 of 27
(7,629 Views)

hi dan,

i tried a lot as u said but still i m facing the same problem. Can u plz....post the vi in lv 7.0 or the complete image having for loop changes bcoz i might b making some minor mistakes. Also, 1 more question, do i need to set some timestamp setting in scan from string tool bcoz its also giving me error of too many format specifiers.

 

 

Thnks

0 Kudos
Message 8 of 27
(7,620 Views)

Hi dan_u,

 

I didn't get a sample data from him, so i generated it using a "get time stamp" function and then tried to run it. It was running fine. There was nothing wrong in the code. But i had passed the value as Time in the first column and Date in the second. So the values which were coming in the output were wrong. Don't know why, i got this feeling that even he must be getting the same error and posted my previous post.. Hope you wont mind..To be honest, I was a bit careless while sending it.Smiley Happy


Warm Regards,

Nitzz 

0 Kudos
Message 9 of 27
(7,621 Views)

Here is my solution, let me know if it works.

0 Kudos
Message 10 of 27
(7,613 Views)