SimpleDateFormat dateFormat1= new SimpleDateFormat("yyyy-MM-dd");标签:object,String,对象,Object,SimpleDateFormat,date,Date From: https://www.cnblogs.com/Dfrank/p/17318207.html
Object object = dgDetails.get("time");
Date date = null;
try {
date = dateFormat1.parse((String) object);
} catch (ParseException e) {
e.printStackTrace();
}
SimpleDateFormat可以将String转为Date,也可以Date转为String.
.parse(String)
.format(Date)
如果你使用SpinnerDateModel.
可以试一下直接将你这个Object强制转换为Date
Date date = (Date) object;