So right now I have a VI in which when you click Save it saves the current state of the Front Panel as a Jpeg. That all works fine. But I wanted to automatically save the file as the current date by using -%y-%d-%H-%M-%S. That also works fine. The only problem? When saved the name of the file looks like a bunch of random numbers.
Technically this is fine. It's correct. But it looks like crap. Is there a way I can modify the File Format String so that the final file reads "Date: 2017-08-28 Time: 12-54-19"?
Solved! Go to Solution.
Well you probably don't want (or aren't allowed) to have colons in the filename. But there is a function called "format into string". For the format string you can use any words then "%s" as a placeholder. Since your date has 10 characters always, you can just split your string after 10 characters and use "Date %s Time %s" with the first input being your date and the second being time.
Personally, when I collect data during the test it often looks like "20170828_143518_Voltages" for example, and it is easy for me to know the first 8 characters are the date and the next 6 after the underscore are time.
I typically go with something more like "2017-08-28 12-54-19". That space makes a good separation between the Date and the Time. But to answer your question:
Hey, thanks for that. But....you wouldn't know how to insert a ":" so that the time looks like 14:32:12, rather than 14-32-12?
While the colon ":" is not permitted, oddly enough, the semi-colon ";" is permitted as part of a filename. Just replace the "-" after the %H and %M with the semicolon ";" for a close visual approximation.
Yep, that'll work. But I've been looking around the net and have found several examples of Date formatting codes that supposedly give you the current time with colons included. I've tried %T, %t, %X, %x, %Z, %z, and on and on, but nothing works. Does Labview actually have anything like that? Maybe I'm just implementing it wrong.
But in "%H:%M:%S", my Labview doesn't seem to accept the colons. I have 2015 though.