开发者

How to convert date format in sqlite?

I want to convert "13 Jul 2011 06:50:00 PM" to "2011/07/13 18:50", store it in an sqlite DB, and retrieve it with the reverse transformation. How could I do this? Please give me some example code.

Thanks in开发者_高级运维 advance..


Use this:

SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd, HH:mm");
String dateString = formatter.format(new Date(date));
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜