2011-07-13 75 views
0

我正在使用sqlite進行數據操作。 我如何插入日期時間值sqlite 我在我的應用程序中實現了下面的代碼。 它的工作原理,使用sqlite的數據操作

SimpleDateFormat curFormater = new SimpleDateFormat("dd-MMM-yyyy",Locale.ENGLISH); 
Date dateObj = null; 
dateObj =curFormater.parse(txt_date_start.getText().toString()); 
SimpleDateFormat postFormater = new SimpleDateFormat("yyyy-MM-dd",Locale.ENGLISH); 
String newDateStr = postFormater.format(dateObj); 

,但我希望保存爲「2011年07月13下午5時15」,PLE給我..例如

在此先感謝

回答

2

在sqlite中,您沒有任何數據類型作爲日期或time.while創建列ü必須指定任何一個文本,int或真正的數據type.then插入時使用的日期和時間funcs的sqlite 。

0

創建源碼的專欄表類型爲TIMESTAMP/DATE,並將日期放在UNIX時間戳中。