Im getting timeStamp from Sqlite like this:
"timestamp" + " TIMESTAMP DEFAULT CURRENT_TIMESTAMP );"
This is how i get the date: 2019-06-23 04:25:28
and i'm transforming to get the days
and im getting this 18070 and not the int day
String timestamp = cursor.getString(cursor.getColumnIndex(VentasContract.TIME_STAMP));
Log.d("TIEMPO",timestamp);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = sdf.parse(timestamp);
long millis = date.getTime();
long days = (millis / (60*60*24*1000));
Log.d("DIA",String.valueOf(days));
// The value of TIEMPO is 2019-06-23 04:25:28
// The value of DIA is 18070
I expect the current day "23"