在我的应用程序中,我使用这样的代码:
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale);
df.setTimeZone(User.getTimeZone());
String s = df.format(d);
在跨不同语言环境使用的应用程序中格式化日期。有时,我想为此添加几秒钟,但我不想只使用 SimpleDateFormat 指定一种特定格式,因为我会失去基于语言环境的格式的功能。
那么,有人知道如何对语言环境格式的日期进行细微更改吗?
干杯,
克里斯