i have a string containing date in format yyyyMMddHHmmss (e.g.) (20180626170555) and i am using following code to convert it into date time
dateTimeFromString(
to convert from "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
to 'MM/dd/yyyy hh:mm a'
date = '2021-01-26T03:17:00.000000Z';
DateTime parseDate =
new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(date);
var inputDate = DateTime.parse(parseDate.toString());
var outputFormat = DateFormat('MM/dd/yyyy hh:mm a');
var outputDate = outputFormat.format(inputDate);
print(outputDate)
output 01/26/2021 03:17 AM