04-11-2010 06:35 PM
I'm writing an Labview application in which i read date data from a file which is on this format : 11 Apr 2010
I want to convert this format to another like this 11-4-2010. I use the "Scan From String" function but i couldn't make the conversion.
Solved! Go to Solution.
04-11-2010 07:32 PM - edited 04-11-2010 07:37 PM
Set the format for the timestamp indicator as shown in the comment.
04-12-2010 07:22 AM
04-12-2010 07:26 AM
04-12-2010 09:01 AM
Grazanis, what happens if you format a timestamp like you 'scanned' it?
The %b abbreviation is localized, meaning it is dependent on the language setting of the computer.
Ton
04-12-2010 09:17 AM
What is it doing or not doing? Any error messages?
Here is that snippet saved back to LV 8.5. Try that.
04-13-2010 09:21 AM
Thank all of you for the help again.
The vi runs normal with no errors. I try and your .vi Ravens Fan which is the same like this i have made.
On the front panel the output 1 is DD-MM-YYYY and not 11-4-2010.
TCPlomp if it is dependent on the language setting of the computer how can i change it. I have win vista with greek language.
I want to make it on this format (11-4-2010) because then i want to make this number 20100411 and make comparisons.
The numbers are more flexible with mathematics functions.
04-13-2010 02:24 PM
It works fine for me in LV 8.5.1. Though the month comes out as 04 and not 4. I personally prefer 1 digit months and days and 2 digit years. So 4/11/10 for April 11, 2010. According to the help file "Format Codes for the Time Format String" it appears you can only have 2-digit months and days. So single digiti months and days will have a leading zero. But if you are doing further conversions to rearrange the data further, then you probably want to have that.
Are you getting any error messages? Put an erro indicator on the conversion function. I think Ton is right that if you are using Greek Vista, you will have to use the Greek abbreviation for April to get it to work.
04-14-2010 11:47 AM
Yes you have right i put the Apr with greek characters "Απρ" and i take the month 04.
So first i must hane a sub.vi to change the english abbreviations for months with greek abbreviations on my file.
Thank you for your help !
Where i must push solution button ? (on TCPlomp or Ravens Fan )
04-15-2010 01:05 AM
I don't think there's a function to match a localized string in a different language.
There are two options: