VaR S = +NewDate ();
The explanation is as follows: = + does not exist;
+ New date () is a thing;
+ Equivalent to. valueof ();
See the reply to add. gettime (), which also gets the number of milliseconds.
//Returns the number of milliseconds of the current time as the four results are the same.
Alert (+NewDate ());
Alert (+NewDate );
VaRS =NewDate ();
Alert (S. valueof ());
Alert (S. gettime ());
The following describes how to use js to obtain the time:
Http://www.cnblogs.com/0banana0/archive/2011/05/25/2056614.html
VaRMydate =NewDate ();
VaRA = mydate. tolocalestring ();
2011-11-07 18:13:56
By the way, valueof has another usage:
The valueof () method returns the original value of a Boolean object.
If the object that calls this method is not Boolean, an exception typeerror is thrown.
VaRBoo =NewBoolean (False);
Document. Write (Boo. valueof ());
Other usage: http://www.google.com.hk/search? Sitesearch = w3school.com.cn & as_q = valueof