JavaScript Learning Notes-Reference type Date

Source: Internet
Author: User

Three Date

New Date () the newly created object automatically obtains the current date and time without passing parameters. Timestamp of the parameter receive milliseconds

Date.parse () receives a string representing the date, returning the corresponding number of milliseconds timestamp. Date strings are formatted differently depending on the browser locale. If the passed-in string cannot be resolved, a Nan is returned

The parameters received by DATE.UTC () are year, based on month 0 for January, date of month, 1-31, hour, 0-23, minute, second, millisecond. These parameters are required only for the year and month.

1. Methods of inheritance

Tolocalstring () returns the date and time in a format that is compatible with the locale of the browser

ToString () typically returns a date and time with time zone information, where time is typically expressed in military time.

ValueOf () does not return a string, but instead returns a millisecond representation of the date. You can therefore use comparison operators to compare date values directly

JavaScript Learning Notes-Reference type Date

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.