如何在 SQLite 中将日期时间转换为日期格式? [英] How can I convert datetime to date format in SQLite?
本文介绍了如何在 SQLite 中将日期时间转换为日期格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在数据网格中以 DD-MM-YYYY 格式显示日期.默认情况下,SQLite 以日期时间格式存储数据.那么如何在 flex 中使用 SQLite 将日期时间格式转换为日期格式?
I want to show a date in DD-MM-YYYY format in a datagrid. By default, SQLite stores the data in date-time format. So how can I convert date-time format to date format in flex by using SQLite?
推荐答案
您可以使用 strftime
,来自 日期和时间函数.
You can use strftime
, from Date And Time Functions.
示例:
SELECT strftime('%d-%m-%Y', 'now')
输出:
10-06-2010
这篇关于如何在 SQLite 中将日期时间转换为日期格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文