Weird time issues in Javascript !!

Source: Internet
Author: User

The following methods are used to create a new time in javascript:
VaR today = new date ();
Returns the current date and time.

VaR newyear = new date (December 31,199 8 23:59:59 );
The input is the form string "month, day, year, hour: minute: second"

VaR bday = new date (75, 1, 16 );
The parameter value is year, month, or day.

VaR bday = new date (75, 1, 16, 12, 0, 0 );
The parameters are year, month, day, hour, minute, and second.

Originally in Program It is shown that there is no problem, but today we found a serious problem. If the last three methods are used today, the date will be set to 9-1.
Setdate ()
Set The day of the month (from 0 to 30)

Sethours ()
Set the hour (from 0 to 23)

Setminutes ()
Set the minute (from 0 to 59)

Setmonth ()
Set month (from 0 to 11)

Setseconds ()
Set the number of seconds (from 0 to 59)

Settime ()
Set the time (milliseconds since a.m)

Setyear ()
Set year

Set 8-31

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.