我有一段時間生成一個報告,其中包含我的門票的創建日期。Trac sqlite日期查詢
,這裏是我的SQLite查詢(我直接查詢DB)
.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
我錯過了什麼?