开发者

How to convert date format in sqlite?

开发者 https://www.devze.com 2023-03-20 12:39 出处:网络
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.

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

精彩评论

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