I am using websql, but problem is, not finding any date functions in websql. I have date stored in the format Mon Apr 09 2012 15:23:54 GMT+530(India Standard Time)
, and I want the query result in the format 04/09/2012
. Can any body help please?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
WebSql has a strftime
function that should do what you need:
select strftime('%d-%m-%Y', 'now') formattedDate
As noted in the comment below, the data in the column will need to be a valid date time string recognized by SQLite. Check the SQLite Date Functions documentation for more info.