---恢复内容开始--- 时间格式化 Date类型转换成String: Date date = new Date();SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String dBegin = sdf.format(date); String类型转换成Date: String start="2017-11-10"; SimpleDateFormat sdf = new SimpleDateFo…
Java:String和Date.Timestamp之间的转 一.String与Date(java.util.Date)互转 1.1 String -> Date String dateStr = "2010/05/04 12:34:23"; Date date = new Date(); //注意format的格式要与日期String的格式相匹配 DateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss&qu…