Android Question what date format is B4XTable.Setdata looking for?

Mikelgiles

Active Member
Licensed User
Longtime User
I am loading data from a CSV file that has dates in the format of yyyy/mm/dd (2017/05/22) and in the table all dates show up as 12/31/1969 so I assume the date format in the csv file is not proper. I modified a date in the csv file to 20170522120000.000, 05/22/2017, 5/24/2017, and 5/24/17 but but none resulted in the correct date.
 

Mikelgiles

Active Member
Licensed User
Longtime User
It expects ticks (Long) values. You need to set the correct format with DateTime.DateFormat and then convert the date string to ticks with DateTime.ParseDate.

I will be downloading information in the QFX format which will be in a string formated 'yyyymmddhh0000.000'.

If I cant change it I am thinking that I can loop thru the list to preprocess it between getting the list from the csv file and doing the B4XTable.Setdata. Or is there a better option?

I have the column type set to DATE. Do I need to change that to NUMBERS.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
If I cant change it I am thinking that I can loop thru the list to preprocess it between getting the list from the csv file and doing the B4XTable.Setdata. Or is there a better option?
That's the correct way to do it. Don't worry it will be very fast.

I have the column type set to DATE. Do I need to change that to NUMBERS.
No. Date values (ticks) should be stored in DATE columns.
 
Upvote 0
Top