My app downloads a CSV file from an FTP server and reads a date, eg 27/02/2012, from the first line of the file (I have set the date format to "dd/MM/yyyy") - each line of the file contains 5 fields. It then checks if that date is more than 7 days old using the code below.
Dim dateline(), newdate As String
Dim table1 As List
Dim su As StringUtils
If File.Exists(csvpath,csvFile) Then
table1 = su.LoadCSV(csvPath,csvFile,chrSeparator)
dateline = table1.Get(0)
newdate = dateline(0)
If DateTime.DateParse(newdate) > DateTime.DateParse(curdate) Then
The thing is that when I download the file from one FTP server it works fine but when the same file is downloaded from another server I get a Java.text.ParseException: Unparseable date: "27/02/21012". If I run it in debug mode and check the contents of newdate it seems to be exactly the same in both cases. Any ideas about what could be causing this?
Thanks.
SC
Dim dateline(), newdate As String
Dim table1 As List
Dim su As StringUtils
If File.Exists(csvpath,csvFile) Then
table1 = su.LoadCSV(csvPath,csvFile,chrSeparator)
dateline = table1.Get(0)
newdate = dateline(0)
If DateTime.DateParse(newdate) > DateTime.DateParse(curdate) Then
The thing is that when I download the file from one FTP server it works fine but when the same file is downloaded from another server I get a Java.text.ParseException: Unparseable date: "27/02/21012". If I run it in debug mode and check the contents of newdate it seems to be exactly the same in both cases. Any ideas about what could be causing this?
Thanks.
SC