2008/05/26/23.41.01

Converting dates in SQLite

If you have a date stored as seconds (not milliseconds*) since The Epoch, you can convert it to a more readable date in SQLite through the strftime function.

An example would be, “strftime(”%Y-%m-%d”,date,’unixepoch’)”.

* - Since the Date object in AS3 has the getTime method returning milliseconds since The Epoch, you’d just need to either divide by 1000 before saving it in a SQLite DB, or divide by 1000 inside the call to strftime.

Original post by richard.lyman and software by Elliott Back

Comments are closed.