I need to get day (number), month (number) and year from a date using month's french name.
I know how to do it using month's english name:
How can I accomplish this using french for the month? I.e:
Here is what I tried:
Thanks in advance.
I know how to do it using month's english name:
const dt = new Date("12 may 1996");
const day = dt.getDate();
const month = dt.getMonth();
const year = dt.getFullYear();
console.log(day, month, year); // 12 4 1996
How can I accomplish this using french for the month? I.e:
const dt = new Date("12 mai 1996");
Here is what I tried:
const dt = new Date("12 mai 1996");
const day = dt.getDate();
const month = dt.getMonth();
const year = dt.getFullYear();
console.log(day, month, year); // NaN NaN NaN
Thanks in advance.