Jquery - Date Format Change

function formatDate(dateStr) {
let date = new Date(dateStr);
let day = date.getDate().toString().padStart(2, '0');
let month = (date.getMonth() + 1).toString().padStart(2, '0');
let year = date.getFullYear();
return `${day}-${month}-${year}`;
}

3 Comments

Image
Killian Mider
Jul 22, 2023 | 7:10 PM

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.

Image
Everly Leah
Jul 23, 2023 | 7:10 PM

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.

Image
Michel Ohio
Jun 14, 2023 | 7:10 PM

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam.

Leave A Comment

Your email address will not be published. Required fields are marked.