timeDateFormat static method
Implementation
static timeDateFormat({String? date, String? locale}) {
try {
if (date?.isNotEmpty == true) {
var time = date?.split("+");
initializeDateFormatting(locale);
var inputFormat = DateFormat("yyyy-MM-dd HH:mm:ssZ");
var inputDate = inputFormat.parse(time![0]);
var outputFormat = DateFormat('dd/MM/yyyy, hh:mm a');
var outputDate = outputFormat.format(inputDate);
return outputDate.toUpperCase();
} else {
return "unknown";
}
} catch (e) {
return "format error";
}
}