Easy in PHP but how will it be in Java.
$value="1562916792";
echo date("Y-m-d h:i:sa", $values['time']);
output: 2019-07-12 01:03:12pm
$value="1562916792";
echo date("Y-m-d h:i:sa", $values['time']);
output: 2019-07-12 01:03:12pm
To get that time, I'll assume you are in India time zone, in which case you do it like this:
Using Java 8 Time API
int value = 1562916792;
System.out.println(Instant.ofEpochSecond(value)
.atZone(ZoneId.of("Asia/Kolkata")) // or ZoneId.systemDefault()
.format(DateTimeFormatter.ofPattern("uuuu-MM-dd hh:mm:ssa")));
Using old Java Date API
int value = 1562916792;
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Kolkata"));
System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm:ssa").format(value * 1000L));
Output
2019-07-12 01:03:12PM