I\'m parsing an xml file with SAXParser and inside the handler I\'m creating objects with one of the datamembers being the date.
The date on my XML file is in this f
You can use Java's Simple Date Format to format your date into a Date
object that you can use to do calculations and such:
http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html
The parse string you want is "yyyy'-'MM'-'dd"
As for storing it into the SQLite database, you have a couple of options:
Date.getTime()
gives you the number of milliseconds since 1970, and you can store that value in the DB.) This way is preferred because you don't have to do so many (relatively expensive) conversions. You can simple do basic operations on the long
timestamp values.There are a couple of other options using SQLite's built in date functions (as described here), but ultimately if you want to pull it into the Android/Java code and manipulate it as a Date
object you're going ot have to do a conversion.