Click in Import and choose the associated .txt file
CLick in Read to load / display the data from the .sqlite file
Click in Tag Debug to display the Tag associated with the Italian date (as you can read above, it’s a 8601 ISO date).
As I wrote in the code, you can store a different value, both have to be Custom Sorted: to my great surprise, the code there works fine
Here’s the project ans the .txt Italian associated data:
Try
LB.AddRow DateTime.FromString(row.Column("DataFattura").StringValue,ital).SQLDate
Catch err As RuntimeException
If err.Message <> "Date is not in an accepted format for parsing" Then Raise err
LB.AddRow ""
End Try
Usually, when I use two lines of code instead of one it is because I had troubles and want to know who’s line is faultive. Looks like it is a case.
But well spotted.
Maybe even (better be safe than sorry):
as always, you are correct. But I knew the dates are OK.
Still, you are right. In everyday work I also saw (or sometimes heard on TV: “SEPTEMBER 31ST WILL SEE…” from a member of the Press… !) errors in dates (typos they say).
Just for fun, I made mistakes in the date of the text file and your example program crashed. So I changed the following line:
aDateTime = aDateTime.FromString(aDateStr, Ital)
to
Try
aDateTime = aDateTime.FromString(aDateStr, Ital)
Catch err As RuntimeException
If err.Message <> "Date is not in an accepted format for parsing" Then Raise err
aDateTime = DateTime.FromString("1970-01-01 00:00:00")
End Try
Since you want to help @Federico_Giannetti with your program, I think you could also point out possible challenges. Otherwise it will only lead to more questions.
Mainly to point out possible errors and possible solutions. Because, as you already mentioned, there are often misunderstandings when it comes to dates.
By the way, I think it’s great that you’re doing this work. Thank you very much for that @Emile_Schwarz.