VaR S = + newdate ();

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.