tags:

views:

42

answers:

1

hello, i have a sqlite database on my android, whith a datetime column, that contains a date with the Format dd.MM.yyyy. It's not my Database, I'm niot able to change the Dateformat. I want to compare the date in the database with a String, which is representing a secon date, but everything I tryed failed. How can I convert this column to a valid, compareable date? date(), dattime() sdfttime() everything returns NULL.

A: 

Do you want do this in the database (SQL) or in program code? In Java you may use SimpleDateFormat

SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
Date d = sdf.parse("21.03.1997");
Sergey Glotov
I have to do this in the sql code like: AND datetime(d.objectstop) <= '" + fb_str_date
2red13
and `strftime()` also not working?
Sergey Glotov
didn't strftime need a input Value in yyyy-MM-dd format? if i try it, i receive null too
2red13