ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Time Stamp to String

Solved!
Go to solution

What is the most efficienct way to convert a Time Stamp Control to a MM/DD/YYYY string? I am going to use its output as date parameters to a WHERE clause to a SQL Server query.

0 Kudos
Message 1 of 7
(13,017 Views)
Solution
Accepted by Eric1977

Format Date/Time String is a simple option.

 

0 Kudos
Message 2 of 7
(13,013 Views)

I skipped right by that. I must not have had enough coffee yet this morning. Smiley Very Happy

 

Thank you.

0 Kudos
Message 3 of 7
(13,000 Views)

You're welcome Smiley Happy

 

0 Kudos
Message 4 of 7
(12,997 Views)

aa.png

 

Those format codes can be tricky to write from scratch. I usually format a timestamp constant the way I want it displayed, switch to advanced format editing and copy the format string.


"Should be" isn't "Is" -Jay
Message 5 of 7
(12,996 Views)

Jeff,

 

I just did it like this. Do you forsee any problems? I noticed yours had the greater than and less than math operators near the beginning and end of the format string.

 

TimeStampString.png

0 Kudos
Message 6 of 7
(12,991 Views)

@Eric1977 wrote:

Jeff,

 

I just did it like this. Do you forsee any problems?

 


 

Well, what is the output? Do you foresee a problem? The LabVIEW Help is quite clear on the format. The very first sentence of the Help file for the Format Date Time String provide a link to the codes: https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/string/format-codes-for-the-time-fo...

0 Kudos
Message 7 of 7
(12,988 Views)