LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to input the words Date and Time into the File Format String?

Solved!
Go to solution

@ShogunOrta wrote:

my Labview doesn't seem to accept the colons.


Can you explain what this means? What value are you looking at that makes you say this?

0 Kudos
Message 11 of 18
(823 Views)

Here's my code. It's not all of it, but only the code that is ran once the user presses the SAVE button. So, it likely won't work if you try to run it, but you can open it up and see where I'm implementing the Date Time Format coding. 

 

And I mean to say that when I add ":" in the string that represents the file path where the picture is to be saved, the save no longer works. It's as if it doesn't accept the colons. And I basically just wanted to replace the dashes with colons.

0 Kudos
Message 12 of 18
(818 Views)
Solution
Accepted by topic author ShogunOrta

Yes, I told you in the first response that you wouldn't be able to use a colon in a filename (as have a couple others). For more info on illegal characters in Windows see here.

Message 13 of 18
(807 Views)

Alright, thanks. But so this doesn't work?   %<%m/%d/%Y %I:%M:%S %p>T

 

I found it in another forum. The OP swears it works for Labview, but it didn't work for me and you pretty much confirm colons are a no-go. Why do I see so many people presenting code with colons in them and it works for them? Maybe do they have an updated version of Labview? I'm running 2015.

0 Kudos
Message 14 of 18
(797 Views)

Those characters just aren't allowed in filenames (like the picture you are trying to save). They are fine to use if you just want the string in LabVIEW, or even as some data in a file, just not as the filename.

0 Kudos
Message 15 of 18
(794 Views)

@ShogunOrta wrote:

Why do I see so many people presenting code with colons in them and it works for them?


Let me try rephrase this in simple terms...

colon in string = good

colon in path = bad


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 16 of 18
(794 Views)

@crossrulz wrote:

@ShogunOrta wrote:

Why do I see so many people presenting code with colons in them and it works for them?


Let me try rephrase this in simple terms...

colon in string = good

colon in path = bad


I might recommend joining this meeting to help you get over your loss.


"Should be" isn't "Is" -Jay
Message 17 of 18
(779 Views)

@ShogunOrta wrote:

Alright, thanks. But so this doesn't work?   %<%m/%d/%Y %I:%M:%S %p>T

 

I found it in another forum. The OP swears it works for Labview, but it didn't work for me and you pretty much confirm colons are a no-go. Why do I see so many people presenting code with colons in them and it works for them? Maybe do they have an updated version of Labview? I'm running 2015.


Maybe they don't use it as Filenames? Maybe they don't run on windows? If you create a string indicator you'll see that it works perfectly, it's just not allowed in a filename. You can easily test it be trying to rename a file in the Explorer to something including ':'.

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 18 of 18
(755 Views)