我正在为我的门票生成一份包含创建日期的报告,这真是太棒了。
这是我的sqlite查询(我直接查询数据库)
.header on
.mode csv
.output opentickets.csv
SELECT DISTINCT
id AS ticket, summary, status, priority, t.type AS type,
owner, time as created
FROM ticket t, ticket_custom q
LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
WHERE t.id = q.ticket AND status <> 'closed'
ORDER BY priority, time;
但是我在创建时得到的值是垃圾:我得到 1341324096360000 当我应该得到 2012-07-03
我试过 unix 纪元时间转换...查询:
.header on
.mode csv
.output opentickets.csv
SELECT DISTINCT
id AS ticket, summary, status, priority, t.type AS type,
owner, datetime(time, 'unixepoch') as created
FROM ticket t, ticket_custom q
LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
WHERE t.id = q.ticket AND status <> 'closed'
ORDER BY priority, time;
我得到:-1413-03-01 13:07:12
我错过了什么?