How can I convert datetime to date format in SQLite?

后端 未结 2 637
轮回少年
轮回少年 2020-12-16 13:11

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 fle

相关标签:
2条回答
  • 2020-12-16 13:46

    You can use strftime, from Date And Time Functions.

    Example:

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

    output:

    10-06-2010
    
    0 讨论(0)
  • 2020-12-16 13:47

    Look up Java until Date. It has methods to convert and is supported in SQLite. However it is mostly deprecated and replaced with Calender.

    0 讨论(0)
提交回复
热议问题