java.util.Date格式转化

Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
        String time = sdf.format(date.getTime());
        System.out.println(time);

猜你喜欢

转载自blog.csdn.net/weixin_42273990/article/details/80614831