Solution
Example dateString = ‘2024-03-31T07:00:00.000Z’
Code
function formatDateToDDMMYYYY(dateString) {
const date = new Date(dateString);
const day = date.getDate().toString().padStart(2, '0');
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const year = date.getFullYear().toString();
return day + "/" + month + "/" + year;
}