中文日期格式转成英文日期格式

/*将中文日期格式转换成英文格式*/
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date salesDate = format.parse(salesOrder.getSaleDate().toString());
Locale locale = new Locale("en");
String day = String.format("%td", salesDate);
String month = String.format(locale, "%tb", salesDate);
String year = String.format("%ty", salesDate);
String date = day + "th," + month + ".," + year;
Label row8Label4 = new Label(9, 7, date, contCellFormatLeft);
sheet.addCell(row8Label4);

你可能感兴趣的:(java)