I want to convert A UTC date to CEST and vice versa. The below is the date
2018-09-05T13:30:10,980.
What is the approach to this ?
This is what i have done from another example. I want to check that if this is correct way of doing it or we can use any Java 8 feature recommendation
DateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss','SSS");
utcFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = utcFormat.parse("2018-08-22T08:54:43,907");
DateFormat pstFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss','SSS");
pstFormat.setTimeZone(TimeZone.getTimeZone("CET"));
System.out.println(pstFormat.format(date));