The code of Bitter B:
These two days to write a calendar control, tune a half-day how can not get the value of the desired, and finally found that the pit was very miserable.
Getday (): Return one day of the week, Sunday is 0, Monday is 1, Saturday is 6
GetMonth (): Return to the Month 0-11,,, this pit, unexpectedly started with 0
GetYear (): This is even more pit, return unknown three digits I x, with getFullYear () only normal
New Date ("2014/11/12"); Define Date Type 2014-11-12
New Date (2014,10,12); Define date type 2014-11-12, this month's argument starts with 0, another pit.
Before you are unfamiliar with JavaScript date operations, please look carefully at the date operation manual to avoid the pit
reference materials:
Date () Returns the day and time.
GetDate () returns one day of one months (1 ~ 31) from the Date object.
Getday () returns one day of the week from the Date object (0 ~ 6).
GetMonth () returns the month (0 ~ 11) from the Date object.
getFullYear () returns the year with a four-digit number from the Date object.
GetYear () Please use the getFullYear () method instead.
GetHours () returns the hour of the date object (0 ~ 23).
Getminutes () returns the minute (0 ~ 59) of the Date object.
Getseconds () returns the number of seconds (0 ~ 59) of the Date object.
Getmilliseconds () returns the milliseconds (0 ~ 999) of the Date object.
GetTime () returns the number of milliseconds since January 1, 1970.
Setdate () Sets the day of the month in the Date object (1 ~ 31).
Setmonth () sets the month (0 ~ 11) in the Date object.
setFullYear () sets the year (four digits) in the Date object.
Setyear () Please use the setFullYear () method instead.
Sethours () Sets the hour in the Date object (0 ~ 23).
Setminutes () Sets the minutes in the Date object (0 ~ 59).
Setseconds () Sets the seconds in the Date object (0 ~ 59).
Setmilliseconds () Sets the milliseconds in the Date object (0 ~ 999).
SetTime () Sets the Date object in milliseconds.
ToString () Converts the Date object to a string.
toTimeString () Converts the time portion of the Date object to a string.
toDateString () Converts the date part of a Date object to a string.
toGMTString () Please use the toutcstring () method instead.
toUTCString () Converts a Date object to a string based on the universal.
toLocaleString () Converts the Date object to a string based on the local time format.
toLocaleTimeString () Converts the time portion of a Date object to a string, based on the local time format. toLocaleDateString() converts the date part of a Date object to a string, based on the local time format.