Dart - Convert time from dd/MM/YYYY to YYYY-MM-dd
var inputFormat = DateFormat("dd/MM/yyyy");
var date1 = inputFormat.parse("18/08/2019");
var outputFormat = DateFormat("yyyy-MM-dd");
var date2 = outputFormat.parse("$date1"); // 2019-08-18
Or you can use String
var date2String = outputFormat.format(date1); // "2019-08-18"