I want to convert UTC time to my desiered time zone, Im trying with the following code
//inputDate - Timestamp (2016-10-15 12:30:00)
//toZoneId - Australia/Sydney
ZonedDateTime utcDateTime = ZonedDateTime.ofInstant(inputDate.toInstant(), ZoneId.of("UTC"));
Timestamp convertedTime = Timestamp.valueOf(utcDateTime.withZoneSameInstant(ZoneId.of(toZoneId)).toLocalDateTime());
return convertedTime;
I get same "2016-10-15 12:30:00" as output not the UTC equivalent date time. What am I missing?