For now I'm using this long method to convert user input in format: DD.MM.YY HH:mm
to milliseconds.
let day = date.substring(0, 2);
let mth = date.substring(3, 5);
let yr = date.substring(6, 10);
let hr = date.substring(11, 13);
let min = date.substring(14, 16);
let d = yr + "-" + mth + "-" + day + "T" + hr + ":" + min + ":00.000+02:00";
d = new Date(d).getTime();
Is there any easier, preferable way to do this? I've read about ISO dates and other norms but I haven't found anything that includes both day/month/year and hours/minutes without unnecessary milliseconds and time zones.
I'm not expert in js dates so be understanding. Thank you in advance.