我的日期在EST
时区。我需要使用Java 8将其转换为EDT
。
我试过了DateFormat.setTimeZone
但是没有用。请注意我的本地服务器处于EDT
时间。
DateFormat edtFormat = new SimpleDateFormat("dd-MMM-YYYY HH:mm zzz");
edtFormat.setTimeZone(TimeZone.getDefault());
return edtFormat.format(date).toUpperCase(Locale.getDefault());