Datetime 带偏移量的SQLite格式日期时间

Datetime 带偏移量的SQLite格式日期时间,datetime,sqlite,datetimeoffset,Datetime,Sqlite,Datetimeoffset,我只想从sqlite3中的datetime列返回日期。问题是我必须在里面有偏移量。该列称为ClientCreatedDate,其值为2011-10-24 20:53:15+0000 通常情况下,如果值如下所示,我只需执行以下操作: Select strftime('%Y-%m-%d', ClientCreatedDate) as convertedDate From Sl_Task 一切都会很好 有了偏移量,我能做些什么吗 2011-10-24 20:53:15 +0000 使用子字符串怎么

我只想从sqlite3中的datetime列返回日期。问题是我必须在里面有偏移量。该列称为ClientCreatedDate,其值为
2011-10-24 20:53:15+0000

通常情况下,如果值如下所示,我只需执行以下操作:

Select strftime('%Y-%m-%d', ClientCreatedDate) as convertedDate From Sl_Task
一切都会很好

有了偏移量,我能做些什么吗

2011-10-24 20:53:15 +0000

使用子字符串怎么样

Select strftime('%Y-%m-%d', substr(ClientCreatedDate,1,19) as ....

sqlite.org上没有很好的文档记录,但确实接受时区偏移(在这种情况下,时间转换为UTC)

但需要在小时和分钟之间输入冒号

> SELECT DATETIME('2012-01-07 13:51:40 -06:00');
2012-01-07 19:51:40