I'm receiving dates in epoch time from an API. They are in string format and what I want is to simply transform it to date without hours, minutes, and seconds, with the format dd / mm / yyyy. Example:
String epochDate = "1590476643";
I was trying just to convert it with the timestamp and I'm getting this result with this logic. I'm getting when a 1970 date when the epoch time is from yesterday may 26.
Date d = new Date(Long.parseLong(epochDate));
Timestamp ts= new Timestamp(d.getTime());
RESULT = 1970-01-19 10:47:56 SHOULD BE 26-05-2020
How could I transform the string to a date and the format?