DateTime formatDate(String date) { var inputFormat = DateFormat("yyyy-MM-dd hh:mm"); var inputDate = inputFormat.parse(date); return inputDate; }