08-28-2017 12:56 PM
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.
Ex. 2017-08-28-12-54-19.
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.
08-28-2017 01:05 PM
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.
08-28-2017 01:16 PM - edited 08-28-2017 01:18 PM
@ShogunOrta wrote:
Ex. 2017-08-28-12-54-19
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:
08-28-2017 02:22 PM
Is that function you used there a Time Stamp function?
08-28-2017 02:38 PM
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?
08-28-2017 02:42 PM
08-28-2017 02:49 PM - edited 08-28-2017 02:53 PM
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.
08-28-2017 02:59 PM
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.
08-28-2017 03:25 PM
The default (unwired) is %c. If you want just the time in 24-hour format you can use "%H:%M:%S"
08-28-2017 03:31 PM
But in "%H:%M:%S", my Labview doesn't seem to accept the colons. I have 2015 though.