I have a date as a string:
var mydate = "05/05/2011"
when I pass this var to a function like:
myfunction(mydate);
I alert the results and get a decimal not the string date:
function myfunction(mydate){
alert(mydate);
}
produces :
0.0004972650422675286
how do I get it back to a date?
I had this problem as well (I was passing the string from codebehind on a popup to a javascript on the opener). My solution was pretty simple.
in asp.net
in javascript
in codebehind:
Without the single-quote surrounding the text it would spit out the decimal jibberish (ie the mathematical result of 5 / 5 / 2011)
I’m guessing in your situation you could do