我不明白java是如何工作的SimpleDateFormat。我想通過Locale顯示日期和時間。Android的日期格式
例如
Locale.setDefault(Locale.FRANCE);
DateFormat correctDateFormatter =SimpleDateFormat.getTimeInstance(SimpleDateFormat.SHORT, Locale.getDefault());
correctDateFormatter.format(date);
所以我迫不及待地輸出24-H格式一樣
23:00
,但我得到它像
11 PM
我如何顯示時間和日期取決於本地和不使用時間模式(「hh:mm」等)?
https://stackoverflow.com/a/18734471/8089931 –
請參閱我的答案以顯示基於時間的區域設置 – Pehlaj
請再次看看我的問題 – Lavan