How can i convert datetime to date format in sqlite selected vaues

狂风中的少年 提交于 2020-03-06 02:27:21

问题


I just try to convert datetime to date, but without success. Help me to do it:

select date('startTime') from usertable ;

select datetime(substr(startTime, 7, 4 )) from usertable;

回答1:


Just try this.. it will convert datetime to date.

SELECT strftime('%d-%m-%Y', fieldname)

SELECT strftime('%d-%m-%Y', 'now') gives output 5-06-2015


来源:https://stackoverflow.com/questions/30661177/how-can-i-convert-datetime-to-date-format-in-sqlite-selected-vaues

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!