19

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Nidhi
  • 755
  • 3
  • 11
  • 25
  • For future readers, if you want the "usual" date format (`YYYY-MM-DD`) then you can also just use `DATE`: `SELECT DATE(date_time)` – Bilbottom Aug 26 '23 at 07:31

2 Answers2

40

You can use strftime, from Date And Time Functions.

Example:

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

output:

10-06-2010
Nick Dandoulakis
  • 42,588
  • 16
  • 104
  • 136
-6

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131