2016-04-22 34 views
0

我有這個qoute一個問題:保存和整理日期和時間的SQLite

SELECT _id, todo_name, todo_date_start, time_start FROM todo ORDER BY todo_date_start ASC 

有沒有一種簡單的方法由啓動日期(DD.MM.YYYY)爲了我的待辦事項和啓動時間(時:分)? 它仍然適用於日期之前的訂單。

COLUMN_DATE_START + " text not null, " 
     + COLUMN_TIME_START + " text not null, " 

誰能幫助我:

表與文本格式創建?

+1

'由開始日期(DD.MM.YYYY)和起始時間(小時:分鐘)'正確的格式是'YYYY-MM -ddThh:mm' - 只需要** 1 **列 –

回答

-1

嘗試這種情況:

SELECT _id, todo_name, todo_date_start, time_start FROM todo 
ORDER BY date(todo_date_start), time(time_start) ASC 

sqlite date and time functions

+0

'ASC'可以省略,因爲它是**默認值**。 –