parseRfc822 static method

DateTime? parseRfc822(
  1. String input
)

Implementation

static DateTime? parseRfc822(String input) {
  var splits = input.split(' ');
  var reformatted =
      '${splits[3]}-${_months[splits[2]]!}-${splits[1].length == 1 ? '0${splits[1]}' : splits[1]} ${splits[4]} ${splits[5]}';

  return DateTime.tryParse(reformatted);
}