LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Convert Time Stamp to String for Filename use

I'm writing an Labview application in which I would like to convert pull time stamp infor from Time Stamp VI and convert to string so I can use to append as part of filename.

 

The fomat that I want may look something like basefilename081208_1300.  This would represent a file name that has elements consisting of the date 08/12/08 and 13:00 hours zulu.

 

Paul 

0 Kudos
Message 1 of 13
(27,009 Views)

Hello:

 

Use the Format Date/Time String VI, and use as the format string the following: %d%m%y_%H%M

 

 This way you'll get the date string you want. 

 

Then concatenate the output to other strings you need to name your file.

 

I've attached an screenshot.

 

Hope this helps.

 

Robst.



Robst - CLD

Using LabVIEW since version 7.0


Message 2 of 13
(27,006 Views)

One advice, if you go for a filename with the timestamp in it, you might want to sort the files later on.

So a style of year-month-day-hour-minute-second might be more suitable.

In the function shown by Rob you can include the basefilename as well.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 3 of 13
(26,956 Views)

I got the formatting part.

How then to make the string into a file path for saving data to a file?

0 Kudos
Message 4 of 13
(26,681 Views)

I found it after a long time searching... I should use "string to path."

 

Sorry for the interruption.

 

0 Kudos
Message 5 of 13
(26,674 Views)
This thread has been very helpful, solved me 2 big "HOW-TO" questions! Thank you!
0 Kudos
Message 6 of 13
(25,940 Views)

Attached is a screen shot of a more complete picture.

Also attached is the complete VI. This is my first try at attaching a VI. Hope it works.

Message 7 of 13
(25,899 Views)
unfortunately, i have 8.5 in my university, so i cannot load any VI made in 8.6! Thank you for the photo though, it has been very helpful!
0 Kudos
Message 8 of 13
(25,888 Views)

I saved it as LabView 8.5.

See attached.

 

Message 9 of 13
(25,880 Views)

Thank you Ewjammer!

It works like a charm!

0 Kudos
Message 10 of 13
(25,826 Views)