var s= newDate();
The explanation is as follows: = does not exist;
new Date() is a thing;
is equivalent to .valueOf();
I will add .getTime after seeing the reply. ()This also gets the number of milliseconds
//4 results The same returns the number of milliseconds of the current time
alert( new Date());
alert( new Date);
var s=new Date();
alert(s.valueOf());
alert(s.getTime());
Comes with js for various usages of getting time:
http://www.jb51.net/article/28910. htm
var myDate = new Date ();
var a=myDate.toLocaleString( );
2011-11-07 18:13:56
By the way, another usage of valueOf:
The valueOf() method returns the original value of the Boolean object.
If the object on which this method is called is not a Boolean, a TypeError exception is thrown.
var boo = new Boolean(false);
document.write(boo.valueOf());
Other usage:
http://www.jb51.net/w3school/js/jsref_valueof_math.htm