0

How can I make this work ?

DateTime test = DateTime.parse("31.01.2020 00:00:00");

It gives this error:

"Invalid date format 31.01.2020 00:00:00"

Umut Arpat
  • 454
  • 1
  • 6
  • 18

1 Answers1

1

Try using the intl package.

import 'package:intl/intl.dart';

DateTime test = DateFormat('dd.MM.yyyy HH:mm:ss').parse("31.01.2020 00:00:00");
Jacob Phillips
  • 8,841
  • 3
  • 51
  • 66