From reading about them I understand that the android class is a utility class made for convenience only, and provide nothing that SimpleDateFormat doesn’t provide. Is there any significance to the android class? Is it better practice to use it (if yes, why)? My goal is to display a Date object in an android app (obviously). Here it is:
private Date date;
public String getDateString(String formatStr){
return new SimpleDateFormat(formatStr).format(date);
}
would it be better to use android.text.format.DateFormat like this:
public String getDateString(String formatStr){
return android.text.format.DateFormat.format(formatStr, date);
}
or perhaps none of the two, but a different way would be best? thanks in advance.
I believe the answer lies here:
I don’t think the SimpleDateFormat provide appropriately-localized formats.