I want to bind data in a dd-mm-yy
format for which I am using json
to bind. Currently I get date as 2014-06-18T00:00:00
I want in dd-mm-yy
format. Kindly let me know how to do that.
Below is my code for the same.
if (getJSONValue.LAUNCH_DATE != "" || getJSONValue.LAUNCH_DATE == null) {
$('#txtLaunchDate').val(getJSONValue.LAUNCH_DATE);
}
my getJSONValue.LAUNCH_DATE
= 2014-06-18T00:00:00
see snippet
var newDate = new Date("2014-06-18T00:00:00");
var day = newDate.getDate();
var month = newDate.getUTCMonth() + 1;
var year = newDate.getFullYear();
console.log(day + "-" + ("0" + (month)) + "-" + year );
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments