I am trying to change the format of a date from one to another, for exmple 10/05/2012 14:30:56 to 10th May 2012 12:30:56
The javascript function that Ive used is
var monthNames = new Array("January", "February", "March","April", "May", "June", "July", "August", "September", "October", "November", "December");
var today = new Date("10/05/2012 14:30:56");
var cDate = today.getDate();
var cMonth = today.getMonth();
var cYear = today.getFullYear();
var cHour = today.getHours();
var cMin = today.getMinutes();
var cSec = today.getSeconds();
alert( monthNames[cMonth] + " " +cDate + "," +cYear + " " +cHour+ ":" + cMin+ ":" +cSec );
The output the I get is October 5th which is incorrect. So how do I interchange the date and month?