|
|
|
@ -21,7 +21,7 @@ public class DateUtils {
|
|
|
|
|
public static String getDate() {
|
|
|
|
|
//日期转换为字符串
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyyMMddhhmmss");
|
|
|
|
|
DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
|
|
|
|
return now.format(format);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -69,7 +69,7 @@ public class DateUtils {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static Date strToDate(String strDate) {
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
|
|
|
ParsePosition pos = new ParsePosition(0);
|
|
|
|
|
Date strtodate = formatter.parse(strDate, pos);
|
|
|
|
|
return strtodate;
|
|
|
|
|