I am using java and Persian date (you can choose your TimeZone)! Its full date and Time without Second!
and you can use it like :
view.text = DateUtil.getPersianDateTimeShort(date, " - ")
public static String getPersianDateTimeShort(String dateStr, String separator) {
String out = "";
try {
if (dateStr == null || dateStr.equals(""))
return out;
String date = getPersianFullDate(dateStr);
String time = getPersianShortTime(dateStr);
out = date + separator + time;
return out;
} catch (Exception e) {
Log.e(DateUtil.class.getSimpleName() + ":getPersianDateTime", e.getClass().getName() + ": " + e.getMessage());
return "";
}
}
public static String getPersianShortTime(String dateStr) {
return getPersianShortTime(dateStr, "HH:mm", TimeZone.getDefault());
}
public static String getPersianShortTime(String dateStr, String timeFormat, TimeZone timeZone) {
String out;
try {
if (dateStr == null || dateStr.equals(""))
return "";
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm", Locale.ENGLISH);
sdfDate.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = sdfDate.parse(dateStr);
sdfDate = new SimpleDateFormat(timeFormat, Locale.ENGLISH);
sdfDate.setTimeZone(timeZone);
String time = sdfDate.format(date);
out = time;
return out;
} catch (Exception e) {
Log.e(DateUtil.class.getSimpleName() + ":getPersianTime", e.getClass().getName() + ": " + e.getMessage());
return "";
}
}