Archive for August, 2011

Android: Sqlite long to datetime

August 21, 2011

If you store time using android.text.format.Time.toMillis, it will end up in the sqlite as a 13 chars “text/numeric”, something like “1311123600000”. You can do the following to make them human readable:

SELECT datetime(start/1000, 'unixepoch') as start, datetime(end/1000, 'unixepoch') as end from countdowns

//output: 2011-07-20 01:00:00 (I think this means 12:00 AM but I am not sure)

Advertisements