1
A
回答
5
試試這個:
DateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
DateFormat outputFormat = new SimpleDateFormat("dd, MMM yyyy");
Date yourDate = inputFormat.parse("2010-04-20 05:34:58.0");
String formattedDate = outputFormat.format(yourDate);
5
你可能想試試這個:
SimpleDateFormat inFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
Date date = inFormat.parse("2010-04-20 05:34:58.0");
SimpleDateFormat outFormat = new SimpleDateFormat("dd, MMM yyyy");
System.out.println(outFormat.format(date));
相關問題
- 1. 在R中需要幫助格式化日期
- 2. 需要日期格式幫助
- 3. 需要幫助:日期格式
- 4. PHP:這個日期格式化幫助
- 5. 需要幫助格式化Google API的日期時間時區
- 6. 幫助日期格式
- 7. 幫助日期格式
- 8. php日期格式幫助
- 9. Android日期格式幫助
- 10. Java的日期格式幫助文檔本地化UI
- 11. 需要幫助從XML輸出格式化Unix日期。
- 12. 日期排序與日期格式化程序的幫助
- 13. 日期時間戳所需的幫助
- 14. 如何在Typscript中將日期格式化爲所需日期
- 15. 的Java printf的幫助中格式化
- 16. 在Java中將日期字符串格式化爲所需日期
- 17. 需要幫助格式化字符串在Java中
- 18. 需要小的幫助,在紅寶石轉換日期格式
- 19. 的Java格式化日期
- 20. 需要格式化日期
- 21. 需要幫助從此日期格式中提取日期,月份和年份
- 22. 需要幫助格式化代碼
- 23. CSS需要「格式化」幫助
- 24. 需要幫助格式化JAXB輸出
- 25. 需要幫助格式化數字C++
- 26. 需要字符串格式化幫助
- 27. 我得到了錯誤的日期格式 - 需要幫助
- 28. 需要幫助的特定日期格式
- 29. 需要幫助的轉換日期格式
- 30. 如何在java中格式化日期?
如何構建yourDate。我以字符串格式 – bragboy 2010-04-20 14:05:30
有一件事情,這個模式(和我的,下面):這個月將打印一個點,這取決於語言環境。法文:「四月」 – 2010-04-20 14:08:21