I have a string like this : DD/MM/YYYY and i would like to get the year: YYYY the month: MM and the day: DD.
How can I do this by using javascript or typescript?
I already try to use the javascript function getFullYear() but I can't use this function in the string value. I have to convert the string to date. But I can't find the function.
function converteDate() {
let date1 = new Date('24/09/2018');
console.log('Date ---', date1.getFullYear());
}
converteDate();
Thanks for your help.