Convert unix/epoch time to formatted date - unexpected date
问题 Im trying to convert a timestamp to a human readable date and time. I tried: String dateSt = 1386580621268; Log.i("*****", "date st is = "+dateSt); long unixSeconds = Long.parseLong(dateSt); Log.i("*******", "unix seconds is = "+unixSeconds); Date date = new Date(unixSeconds*1000L); // *1000 is to convert seconds to milliseconds SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy"); // the format of your date String formattedDate = sdf.format(date); System.out.println(formattedDate); The