Elan
Elan

Reputation: 1

How can i convert datetime to date format in sqlite selected vaues

I just try to convert datetime to date, but without success. Help me to do it:

select date('startTime') from usertable ;

select datetime(substr(startTime, 7, 4 )) from usertable;

Upvotes: 0

Views: 1649

Answers (1)

Uttam Panara
Uttam Panara

Reputation: 549

Just try this.. it will convert datetime to date.

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

SELECT strftime('%d-%m-%Y', 'now') gives output 5-06-2015

Upvotes: 1

Related Questions