小编Ama*_*ngh的帖子

如何在swing(Core Java)中将dd-mmm-yyyy格式转换为dd-mm-yyyy格式?

转换dd-mmm-yyyydd-mm-yyyy格式。

String dateofbirth = ((JTextField) dobcalender.getDateEditor().getUiComponent()).getText();//date from jcalender

SimpleDateFormat myFormat = new SimpleDateFormat("dd-MM-yyyy");
Run Code Online (Sandbox Code Playgroud)

尝试了以下代码:

System.out.println(myFormat.format(myFormat.parse(dateofbirth)));
myFormat.format(myFormat.parse(dateofbirth));
Run Code Online (Sandbox Code Playgroud)

显示错误parseexception

java date

0
推荐指数
1
解决办法
104
查看次数

标签 统计

date ×1

java ×1