title: Why my DateTime is giving this error ? in flutter
body: <p>Im trying to get a data from firebase witch is String type  . like this format (yyyy-MM-dd – kk:mm) and im trying to pares the String to Datetime but it gives me error please can anyone tell me how to solve the problem ...</p>
  <p>code :</p>
  <pre><code> var retriveDateTime = database_Reference
        .child(&quot;users&quot;)
        .child(_wifiObject.macAddress)
        .child(DateFormat('dd-MM-yyyy').format(DateTime.now()));
  
   if (retriveDateTime != null) {
        retriveDateTime.once().then((value) {
          String formatedtime = value.value['startingTime'];
          startup_time = DateTime.parse(formatedtime);
        });
        insertDataToDatabase();
      } else {
        startup_time = DateTime.now();
        insertDataToDatabase();
      }
  </code></pre>
  <p>The Error I get :</p>
  <pre><code>E/flutter ( 7155): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: FormatException: Invalid date format
  E/flutter ( 7155): 2021-07-29 – 23:46
  /flutter ( 7155): #1      _MyHomePageState.initState.&lt;anonymous closure&gt;.&lt;anonymous closure&gt;
  </code></pre>
  <p>package:alfurat_app/main.dart:16</p>
  <p>when I click on the error its taking me to this :</p>
  <pre><code> startup_time = DateTime.parse(formatedtime);
  </code></pre>