LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change dates of file to the windows format

I am importing data from a CSV file into an array and then getting the date. I cannot change the date format of the CSV file but when in Labview, how can i change the date format from an example of 06/01/2017 into the windows format of 6/1/2017 in Labview. The indicator being use to get the dates is Log Date.

Download All
0 Kudos
Message 1 of 4
(2,906 Views)

@sportsguy99 wrote:

I am importing data from a CSV file into an array and then getting the date. I cannot change the date format of the CSV file but when in Labview, how can i change the date format from an example of 06/01/2017 into the windows format of 6/1/2017 in Labview. The indicator being use to get the dates is Log Date.


I actually prefer the leading zeros.  In fact, I'd actually rather have it as YYYY/MM/DD because it makes it so easy to sort by date.  But because I'm not you, I would probably just process the text to take out the leading zeros.  (Trying to manipulate it as a true timestamp is borrowing trouble.)  There are so many ways to do this, I'll just show a general process:

Split the string up into a month string, a day string, and a year string.  Convert them to (integer) numbers.  Convert them back to strings.  Join them back up.  You could use string functions to search for "0" and replace it with "" instead, but to me it's a waste of coding energy.  Absolutely painless using the conversion technique.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 4
(2,880 Views)

Im a little confused on what you are trying to say. How will this be implemented? and will it delete the leading zeroes?

0 Kudos
Message 3 of 4
(2,867 Views)

I am sure there is a better way but it works...

 

dateq.png

========================
=== Engineer Ambiguously ===
========================
Message 4 of 4
(2,863 Views)