星期二, 2月 19, 2008

在TRAC報告中顯示更新時間

SELECT p.value AS __color__,
   id AS ticket, summary, version, milestone, t.type AS type,
   (CASE status WHEN 'assigned' THEN owner||' *' ELSE owner END) AS owner,
   Datetime(Datetime(changetime,'unixepoch'), 'localtime') as changed,
   time AS created,
   changetime AS _changetime, description AS _description,
   reporter AS _reporter
  FROM ticket t, enum p
  WHERE status IN ('new', 'assigned', 'reopened')
AND p.name = t.priority AND p.type = 'priority'
  ORDER BY changetime desc

 

changetime原先的內容為Julianday,轉成可閱讀的unix時間格格式後,再轉換成localtime。