I have difficulties comparing the date from my android os to a date stored in my sqlite database on the phone. The goal is: I would like to select all rows for a date earlier than today.
That’s how I get the Date – that park works:
android.text.format.DateFormat df = new android.text.format.DateFormat();
String datum = df.format("yyyy-MM-dd", new java.util.Date()).toString ();
For each row in my database I have stored the date as TEXT. e.g. 2012-01-31 (yyyy-MM-dd).
I thought, I could work with “smaller than” ( < ) operator – that worked on a differt project. But, I don’t get the correct dates.
Any ideas? Or – how would you approach that problem?
Thanks in advance!
Marco
Works fine for me.
Can you provide specific test data for which the behavior is not what you expect?