请教一个android问题,在保存数据到SQlite数据库中时,怎么将mm/dd/yyyy
格式的日期转换为yyyy-mm-dd
这种格式?
谢谢。
请教一个android问题,在保存数据到SQlite数据库中时,怎么将mm/dd/yyyy
格式的日期转换为yyyy-mm-dd
这种格式?
谢谢。
SimpleDateFormat new_format= new SimpleDateFormat("yyyy-MM-dd);
SimpleDateFormat sdf = new SimpleDateFormat("mm/dd/yyyy");
Date date;
String local_date = null;
try{
date = sdf.parse(value);
local_date = new_format.format(date);
}catch(ParseException e)
{
e.printStackTrace();
}