stringToDateTime static method

DateTime stringToDateTime(
  1. String source, {
  2. String? pattern,
  3. String? locale,
})

Implementation

static DateTime stringToDateTime(String source,
    {String? pattern, String? locale}) {
  pattern ??= 'yyyy-MM-ddTHH:mm:ss';
  initializeDateFormatting(locale, null);
  return DateFormat(pattern, locale).parse(source);
}