Ajout convertion date millisecondes vers date

This commit is contained in:
Jacques Foucry 2016-08-11 17:41:14 +02:00
parent 390f620ca4
commit f79ca8d00d

View file

@ -105,4 +105,11 @@ public class UtilDate {
return (int) (todayDate.getTime() - oldDate.getTime());
}
public static String convertDate(long dateInMilliseconds) {
DateFormat formatter = new SimpleDateFormat("YYYY/mm/dd hh:MM:ss");
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(dateInMilliseconds);
return formatter.format(calendar.getTime());
}
}