Client Standard/JavaScript & jQuery

[Javascript] Format date to MM/dd/yyyy

denodo 2021. 8. 24. 15:27

var date = new Date('2010-10-11T00:00:00+05:30');
console.log( ((date.getMonth() > 8) ? (date.getMonth() + 1) : ('0' + (date.getMonth() + 1))) + '/' + ((date.getDate() > 9) ? date.getDate() : ('0' + date.getDate())) + '/' + date.getFullYear() );

 

 

출처: https://stackoverflow.com/questions/11591854/format-date-to-mm-dd-yyyy-in-javascript