samedi 7 mars 2015

SQLITE next 24 hours data

i'm looking to select the next 24 hours games from my table:



String sql = "SELECT * FROM teamstable WHERE
((teamdate >= datetime ('now')) AND (teamdate < datetime('now','+24 hours'))) ORDER BY teamdate" ;

Cursor cursor = db.rawQuery(sql, null);


but the result is strange because i have only tomorrow games:



String teamDate48= "2015-03-08 21:30";
.
.

String teamDate54= "2015-03-08 13:00";


i should have also today games :



String teamDate41= "2015-03-07 20:30";
.
.

String teamDate47= "2015-03-07 19:00";


i have to mention, i'm formatting dates to local in the same activity



sdf.setTimeZone(TimeZone.getDefault())

Aucun commentaire:

Enregistrer un commentaire