title: How to format DateTime in Flutter
body: <p>I am trying to display the current <code>DateTime</code> in a <code>Text</code> widget after tapping on a button. The following works, but I'd like to change the format.</p>
  
  <p><strong>Current approach</strong></p>
  
  <pre><code>DateTime now = DateTime.now();
  currentTime = new DateTime(now.year, now.month, now.day, now.hour, now.minute);
   Text('$currentTime'), 
  </code></pre>
  
  <p><strong>Result</strong></p>
  
  <p><code>YYYY-MM-JJ  HH-MM:00.000</code></p>
  
  <p><strong>Question</strong></p>
  
  <p>How can I remove the <code>:00.000</code> part?</p>