Is there a function or a way to convert "01 January 2020" , this form of date to milliseconds since epoch?
Currently I am using this approach :
Map months = {
"Jan": 1,
"Feb": 2,
"Mar": 3,
"May": 5,
"Jun": 6,
"Jul": 7,
"Aug": 8,
"Sep": 9,
"Oct": 10,
"Nov": 11,
"Dec": 12,
};
date = "01 January 2020";
var millis = DateTime(int.parse(date!.substring(date.length - 4, date.length)), months[date.substring(3,6)] ,
int.parse(date.substring(0, 2));
I don't think it is the best approach to use .