Format date in websql

2019-08-07 12:40发布

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?

标签: web-sql
1条回答
forever°为你锁心
2楼-- · 2019-08-07 13:22

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.

查看更多
登录 后发表回答