06-01-2017 08:44 AM
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.
06-01-2017 09:23 AM - edited 06-01-2017 09:26 AM
@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. 😉
06-01-2017 09:33 AM
Im a little confused on what you are trying to say. How will this be implemented? and will it delete the leading zeroes?
06-01-2017 09:46 AM - edited 06-01-2017 09:53 AM
I am sure there is a better way but it works...