convertStringDateToDateTime method

dynamic convertStringDateToDateTime(
  1. dynamic stringDate
)

Implementation

convertStringDateToDateTime(stringDate){

  // Use DateFormat to parse the date string
  DateFormat inputFormat = DateFormat('MMM d, yyyy h:mm:ss a');
  DateTime date = inputFormat.parse(stringDate);
  return date;
}