String getDateFormat(String pattern, DateTime date) { var formatter = DateFormat(pattern); return formatter.format(date); }