日期格式化:SimpleDateFormat().
String str="yyyy-MM-dd HH:mm:ss.SSS";
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat(Str);
String val = sdf.format(date);
String str ="1911-11-11 11:11:11.111";
String pat="yyyy-MM-dd HH:mm:ss.SSS";
SimpleDateFormat sdf = new SimpleDateFormat(pat);
Date date = sdf.parse(str);