我正在获取这种格式的字符串,如下所示
03-12-2018
我想根据 Java 8 标准将其转换为以下格式,请告知
December 03 , 2018
我尝试过的如下所示,但我没有成功,请告知如何实现相同的目标
SimpleDateFormat month_date = new SimpleDateFormat("MMM yyyy", Locale.ENGLISH);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String actualDate = "03-12-2018";
Date date = sdf.parse(actualDate);
String month_name = month_date.format(date);
System.out.println("Month :" + month_name);
相关分类