Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SQLITE STRFTIME添加多个修改器_Sqlite_Strftime - Fatal编程技术网

SQLITE STRFTIME添加多个修改器

SQLITE STRFTIME添加多个修改器,sqlite,strftime,Sqlite,Strftime,我已经尝试了以上两个问题的查询,但我没有找到更多的STRFTIME教程 有人能解决这个问题吗?正确的方法是 1. Use the strftime function with the date 2019-04-01 and display the given date along with the time 2. Use THE strftime function with the date 2019-04-01 and add 2 years to the given date, add 18

我已经尝试了以上两个问题的查询,但我没有找到更多的STRFTIME教程

有人能解决这个问题吗?

正确的方法是

1. Use the strftime function with the date 2019-04-01 and display the given date along with the time
2. Use THE strftime function with the date 2019-04-01 and add 2 years to the given date, add 180 minutes to that date

1. SELECT strftime('%Y-%m-%d %H:%M', '2019-04-01');
2. select strftime('%Y-%m-%d','2019-04-01','+2 years, +180 minutes');
+2年+180分钟必须是单独的参数

您可以在这里找到一些示例:

我想我们不确定打印时间的格式。 因此,我们需要应用所有可能的时间格式

SELECT strftime('%Y-%m-%d %H:%M', '2019-04-01', '+2 years', '+180 minutes');

这可能是该任务的解决方案。

第一个问题的答案是什么question@aenugulakarthik如果您的意思是
选择strftime(“%Y-%m-%d%H:%m”,“2019-04-01”)你需要回答这个问题来说明你得到了什么,以及为什么那不是你想要的(我得到了
2019-04-01 00:00
这正是我所期望的,并且符合我的理解)。@aenugulakarthik你没有设置日期时间(“2019-04-01 11:12”),只是一个日期(“2019-04-01”),所以你得到了一个“00:00”结果!
SELECT strftime('%Y-%m-%d %H:%M:%S', '2019-04-01');
SELECT strftime('%Y-%m-%d %H:%M:%S','2019-04-01','+2 years, +180 minutes');