时间格式转换

例:    参数string   input--》 20.04.2021
out--》 2021-04-20

SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatter2 = new SimpleDateFormat("dd.MM.yyyy");
startDate
= formatter.format(formatter2.parse(startDate));
        //解析成date--》转string

 

posted @ 2021-04-20 23:07  cire  阅读(47)  评论(0)    收藏  举报
/* 看板娘 */