I try to convert a time with timezone to time but failed to, could you please help to advise?
Time with timezone: 2019-01-31T05:20:18.728+02:00 (as you may notice, there is an offset at the end of the time +02:00. Instead of 05:20:18.728+02:00, I want to print out 07:20:18 which means 05:20:18 + the time offset).
Time needed to show: 07:20:18
...
LocalDateTime ldt = LocalDateTime.now(); //my local time is set to GMT
ZoneOffset offset1 = ZoneOffset.ofHours( (offset%24) );
OffsetDateTime odt = ldt.atOffset( offset1);
System.out.println(odt);
...
My question is updated.
Thanks much, Ivy