Format date in websql

自闭症网瘾萝莉.ら 提交于 2019-12-11 11:44:19

问题


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.



来源:https://stackoverflow.com/questions/10104893/format-date-in-websql

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