0

I have a date which is in EST timezone. I need to convert it to EDT using Java 8.

I tried DateFormat.setTimeZone but didn't work. Please note my local server is in EDT time.

DateFormat edtFormat = new SimpleDateFormat("dd-MMM-YYYY HH:mm zzz");

edtFormat.setTimeZone(TimeZone.getDefault());

return edtFormat.format(date).toUpperCase(Locale.getDefault());
Nicolas Filotto
  • 43,537
  • 11
  • 94
  • 122
Vasudevan Nair R
  • 183
  • 1
  • 3
  • 12

0 Answers0