sur*_*190 -2 java android date
以下方法返回日期示例:
2015年3月11日
代替:
2015年3月11日
码:
public static String convertDat(String s) throws ParseException {
SimpleDateFormat converted = new SimpleDateFormat("dd MMMMMMMMMMMMMMMMMMMM yyyy ");
SimpleDateFormat incoming = new SimpleDateFormat("dd-MMM-yyyy");
Date currentDate = (Date) incoming.parse(s);
return converted.format(currentDate);
}
Run Code Online (Sandbox Code Playgroud)
你DateFormat应该是这样的
SimpleDateFormat converted = new SimpleDateFormat("dd MMMM yyyy");
Run Code Online (Sandbox Code Playgroud)
来自SimpleDateFormat文档
M月份
M:1 MM:01 MMM:Jan MMMM:1月 MMMMM:J
| 归档时间: |
|
| 查看次数: |
700 次 |
| 最近记录: |