Convert from Long to date format
问题 I want to convert Long value to String or Date in this format dd/mm/YYYY. I have this value in Long format: 1343805819061. It is possible to convert it to Date format? 回答1: You can use below line of code to do this. Here timeInMilliSecond is long value. String dateString = new SimpleDateFormat("MM/dd/yyyy").format(new Date(TimeinMilliSeccond)); Or you can use below code too also. String longV = "1343805819061"; long millisecond = Long.parseLong(longV); // or you already have long value of