Sqlite: CURRENT_TIMESTAMP is in GMT, not the timezone of the machine

后端 未结 11 897
小蘑菇
小蘑菇 2020-11-29 16:36

I have a sqlite (v3) table with this column definition:

\"timestamp\" DATETIME DEFAULT CURRENT_TIMESTAMP

The server that this database live

11条回答
  •  -上瘾入骨i
    2020-11-29 16:57

    The current time, in your machine's timezone:

    select time(time(), 'localtime');
    

    As per http://www.sqlite.org/lang_datefunc.html

提交回复
热议问题