从java doc中,MEDIUM格式为:MEDIUM更长,例如1952年1月12日
http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormat.html
如何自定义它以便我不显示年份?拼出"Jan"到1月份?
我自己需要这样做吗?*在','*之后将字符串切断,将月份短名称(Jan)映射到其长名称(1月)?
谢谢.
Rob*_*ska 11
// For months like "Jan"
String formatted = new SimpleDateFormat("MMM dd").format(new Date());
// For months like "January"
String formatted = new SimpleDateFormat("MMMMM dd").format(new Date());
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
213 次 |
| 最近记录: |