Archive for the ‘sqlite’ Category

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)


Use .sqliterc in Windows

January 22, 2011


1. In DOS command, type “set” and find where it says “HOMEDRIVE” and “HOMEPATH”;

2. Navigate to the home dir and type “edit .sqliterc” to create the resource file, something like:

.mode column
.header on
.nullvalue NULL