我很困惑如何在Java代码中将ddmmyy字符串转换为dd-MMM-yy日期.示例 -
041110作为字符串将是04-NOV-10作为日期.
任何建议将不胜感激.
谢谢.
就像是
DateFormat input = new SimpleDateFormat("ddMMyy");
DateFormat output = new SimpleDateFormat("dd-MMM-yy");
String result = output.format(input.parse(inputString));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3018 次 |
| 最近记录: |