JavaScript Basics (Method of Date)

Source: Internet
Author: User

Method of Date
Console.log (document.getElementById); Console.log ([].push); Console.log (typeof Date); // "function"
Instance of date
Console.log (typeof NewDate ());//"Object"Console.log (NewDate ());//get the system time of the machine;varTime =NewDate (); Console.log (Time.getfullyear ());//acquisition time year;Console.log (Time.getmonth ())//Get the time month value range "0-11"Console.log (Time.getdate ());//Get Time Day "1-31"Console.log (Time.getday ());//get the day of the week; "0-6" Sunday is 0;Console.log (Time.gethours ())//gets the number of hours "0-23"Console.log (Time.getminutes ());//gets the number of minutes "0-59"Console.log (Time.getseconds ());//get time Seconds "0-59" Console.log (Time.getmilliseconds ());//gets the number of milliseconds "0-999"Console.log (Time.gettime ());//The current time is eight milliseconds from the morning of 1970-1-1;Console.log (Date.now ());//time stamp:

JavaScript Basics (Method of Date)

Related Article

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.