Convert Sqlite BigInt to Date

Mel picture Mel · Aug 27, 2009 · Viewed 10.4k times · Source

I have a Sqlite database that I am using as an ado.net job store for my Quartz.net scheduler jobs. In one table, a column called START_TIME is of type big int.

Is there a way to cast or convert a bigint to a date value? I would like to be able to query the database to see which jobs are scheduled at what date/time and a value such as 633869892000000000 is meaningless.

Thanks!

Answer

Menzi picture Menzi · Jan 12, 2017

This seemed to work for me; select datetime(DateColumn/10000000 - 62135596800, 'unixepoch') from YourTable

Credits to ; https://forums.xamarin.com/discussion/54282/sqlite-datetime-convert-to-net-datetime