dartflutter

Date Time format in Flutter dd/MM/YYYY hh:mm


My Date-Time format at the moment is this

By using this :

Text(new DateTime.fromMillisecondsSinceEpoch(values[index]["start_time"]*1000).toString(), 

I am getting the type of format attached in the picture, however I was wondering if I could get it in dd/MM/YYYY hh:mm??


Solution

  • If you use the intl package

    final f = new DateFormat('yyyy-MM-dd hh:mm');
    
    Text(f.format(new DateTime.fromMillisecondsSinceEpoch(values[index]["start_time"]*1000)));