将Sqlite BigInt转换为Date

6 sqlite date bigint

我有一个Sqlite数据库,我用作Quartz.net调度程序作业的ado.net工作存储.在一个表中,名为START_TIME的列的类型为big int.

有没有办法将bigint转换或转换为日期值?我希望能够查询数据库以查看在哪个日期/时间安排了哪些作业,并且诸如633869892000000000之类的值毫无意义.

谢谢!

Ian*_*emp 8

假设这START_TIME是标准的秒 - 自Unix-epoch,你可以使用:

select datetime(MyBigIntColumn, 'unixepoch');
Run Code Online (Sandbox Code Playgroud)

请参见http://www.sqlite.org/lang_datefunc.html,"修饰符"部分.


小智 8

这似乎对我有用; 从YourTable中选择日期时间(DateColumn/10000000 - 62135596800,'unixepoch')

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