I've seen
Convert from UNIX Timestamp to "Today at: currentTime" using Java
but none of these is working for me.
I have a timestamp : 1503037706145
And I'm using the following code to convert it to a readable date:
Long leadTime = leadData.getLong("addedOn");
Date date = new Date(leadTime*1000);
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy | hh:mm a");
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Calcutta"));
String formattedDate = sdf.format(date);
It's returning 15/05/49599 11:25:45PM
But when I check it on this, it returns Friday, 18 August 2017 07:00:14.817
which is correct. What am I doing wrong ??