开发者

data manipulation using sqlite

i am working on data manipulation using sqlite. how can i insert the datetime value in sqlite i implemented the below code in my app. it works,

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 = postFo开发者_运维技巧rmater.format(dateObj);

but I want to store as "2011-Jul-13 05:15 PM",ple give me example..

thanks in advance


in sqlite you dont have any data type as date or time.while creating the column u have to specify any one of the text,int or real data type.then while inserting make use of the date and time funcs of sqlite.


Create column in sqlite's table with type TIMESTAMP/DATE and put the date in UNIX timestamp.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜