I want to convert number of days since epoch to a date. Let's say I have the following Timestamp in days: 17749
then it should be converted to Monday Aug 06 2018
.
I am trying using the following code:
Date date = new SimpleDateFormat("D").parse(String.valueOf("17749"));
System.out.println(date);
But I am getting Sun Aug 05 00:00:00 PKT 2018
. The date is one day earlier than what it should be and how can I convert it to yyyy-mm-dd?