将长度为10位的时间戳(秒级)转换为时间:
select datetime(createtime, ‘unixepoch’, ‘localtime’) from locations;
将长度为13位的时间戳(毫秒级)转换为时间(秒级):
select datetime(createtime / 1000, ‘unixepoch’, ‘localtime’) from locations;
将长度为13位的时间戳(毫秒级)转换为时间(毫秒级):
select cast(datetime(createtime/1000, ‘unixepoch’, ‘localtime’) as text)||’.’||cast(createtime%1000 as text) from locations ;