SQLITE STRFTIME添加多个修改器
我已经尝试了以上两个问题的查询,但我没有找到更多的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
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');