时间类型转换

来源:互联网 发布:zwift 软件下载 编辑:程序博客网 时间:2024/06/06 18:37
public class DateFormat {    public static void fun() {        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");        String newDate;        try {            newDate = sdf.format(new SimpleDateFormat("yyyyMMdd")                    .parse("20121115"));            System.out.println(newDate);        } catch (ParseException e) {            e.printStackTrace();        }    }    public static void main(String args[]) {        fun();    }}
原创粉丝点击