package com.wnz.test;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class SimpleDateFormat1 {
public static void main(String[] args) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss SS");
Date date = new Date();
String format = sdf.format(date);
System.out.println(format);
String str = "2022/04/23 10:08";
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/MM/dd HH:mm");
Date parse = sdf1.parse(str);
System.out.println(parse.toLocaleString());
}
}