`

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

    博客分类:
  • java
 
阅读更多
/*将中文日期格式转换成英文格式*/
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);
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics