I am receiving the date as "1279340983" so I want to convert to readable format like 2010-07-17. I have tried using following code
String createdTime = "1279340983";
Date date1 = new Date(Long.parseLong(createdTime));
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
System.out.println(sdf1.format(date1));
but it returns 1970-01-16
as output. when tried to online tool it is showing Sat, 17 Jul 2010 04:29:43 GMT
any idea why this code not showing intended output ?