unable to Work with the JavaScripts Date function
I hope that this is the right section to place this thread.
I am using the JavaScript's Date Function to do some validation on my form but when ever I want to print the converted date into an alter it says "NaN".
My form have 4 drop down lists namely 'lstDay1' (Contains day of month like 02), 'lstMonth1' (Contains month like "Nov"), 'lstYear' (Contains Year like 2006) and 'lstTime1' (Contains Time like 4 PM format).
I wish to convert this date as 02/Nov/2006 16:00:00 format using javaScript's datefunction. I am using the following javaScript :
function DisplayDate()
{
var strDateTime = new Date();
var strDate;
var strDD = "02" //document.getElementById('lstDay1').value;
var strMM = "Nov" //document.getElementById('lstMonth1').value;
var strYY = "2006" //document.getElementById('lstYear').value;
var strTime = "4 PM" //document.getElementById('lstTime1').value;
strDate=strDD+"/"+strMM+"/"+ strYY;
alert("Date : " + strDate); //It Prints "02/Nov/2006"
strDateTime = Date.parse(strDate);
alert("Converted Date : "+strDateTime.toString()); //Here it prints NaN
}
I don't know how to convert Time of format 4 PM to hh:mm:ss format. :confused:
An early reply will highly appriciated. :(

