數據庫中存儲的是UTC時間,直接將 UTC 時間轉化爲秒數選擇出來
select id, name, strftime(/"%s/",date_time) from from table1
傳進去北京時間 (2011-05-05 22:00:00) ,實際數據庫是 UTC 時間,直接進行比較
select id from table where date_time >= datetime( '2011-05-05 22:00:00’,’-8 hours’)
數據庫中存儲的是UTC時間,直接將 UTC 時間轉化爲秒數選擇出來
select id, name, strftime(/"%s/",date_time) from from table1
傳進去北京時間 (2011-05-05 22:00:00) ,實際數據庫是 UTC 時間,直接進行比較
select id from table where date_time >= datetime( '2011-05-05 22:00:00’,’-8 hours’)