I have a UTC time in long value: 1555415100000L
I used this source code to convert to local time by timezone.
//data.getTime() = 1555415100000L
String timeFormat = "HH:mm";
SimpleDateFormat sdf = new SimpleDateFormat(timeFormat);
long gmtTime = Long.parseLong(data.getTime()) + TimeZone.getDefault().getRawOffset();
String timeString = sdf.format(new Date(gmtTime));
At GMT+7: timeString = 01:45 (Correct)
But at GMT+6.5: timeString = 00:45 (Incorrect) -> Should be 01:15
Do you have any suggestion to correct time by local ?