I wrote this method. This method returns specific GMT as formatted String. You should give time in millisecond and GMT value to this method.
private String getSpecificGmtDate(long timeMillis, int gmt) {
long time = timeMillis + (gmt * 1000 * 60 * 60);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
return (sdf.format(new Date(time)) + " (GMT " + gmt + ")");
}
output:
System.out.println(getSpecificGmtDate(1555415100000L, 0));
16/04/2019 11:45 (GMT 0)
System.out.println(getSpecificGmtDate(1555415100000L, 3));
16/04/2019 14:45 (GMT 3)
System.out.println(getSpecificGmtDate(1555415100000L, -3));
16/04/2019 08:45 (GMT -3)