将长度为10位的时间戳(秒级)转换为时间:
1 2 |
select cast(datetime(logtime, 'unixepoch', 'localtime') as text),logcontent from logs |
将长度为13位的时间戳(毫秒级)转换为时间(秒级):
1 2 |
select cast(datetime(logtime/1000, 'unixepoch', 'localtime') as text),logcontent from logs |
将长度为13位的时间戳(毫秒级)转换为时间(毫秒级):
1 2 |
select cast(datetime(logtime/1000, 'unixepoch', 'localtime') as text)||'.'||cast(logtime%1000 as text),logcontent from logs |