I have a table in SQLITE with a DATETIME column.
I do a SQL statement which populates it with now()
I want to retreive it and parse it as a Date object in java, with following code:
SimpleDateFormat simpleDateFormat = new SimpleDateFormat
("yyyy-MM-ddHH:mm:ss",Locale.ENGLISH);
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
then I get the date via:
Date d = simpleDateFormat.parse
(recordset.getString(recordset.getColumnIndex("storedate")));
I get parse exception: unparceable date (and I guess it has to do with the format. Anyone can tell me which format it should be or where the error is?
I found out what it was. I had to change the format to this one:
now it works. Guess SQLite is storing datetime objects in this format by default.