Javascript – How to format the date into ISO 8601 ? Is there any predefined method available in JS?
Right now i am using this function const setDuration = () => { const currentDate = new Date(); const newDate = new Date(currentDate.getTime()); const year = newDate.getUTCFullYear(); const month = String(newDate.getUTCMonth() + 1).padStart(2, '0'); const day = String(newDate.getUTCDate()).padStart(2, '0'); const…