Obtain the day of a month, the day of the month, and the day of the month.
[Javascript]
Var Nowdate = ("2012-11-22"). split ("-"), // obtain a date
NowYear = parseInt (Nowdate [0]), // a year
NowMonth = parseInt (Nowdate [1]), // a month
Nowday = parseInt (Nowdate [2]), // one day
Date = new Date (),
Weekday = new Array (7 );
Weekday [0] = "Sunday ";
Weekday [1] = "Monday ";
Weekday [2] = "Tuesday ";
Weekday [3] = "weekday ";
Weekday [4] = "Thursday ";
Weekday [5] = "Friday ";
Weekday [6] = "Saturday ";
Date. setFullYear (NowYear); // set the current year to a certain year
Date. setMonth (NowMonth-1); // set the current month to a month
Date. setDate (Nowday); // set the current day to a certain day
Document. write (NowYear + "year" + NowMonth + "month" + Nowday + "is" + weekday [date. getDay ()] + "<br/> ");
Date. setDate (1); // set the current date to the first day of the month
Document. write (NowYear + "year" + NowMonth + "Month 1 is" + weekday [date. getDay ()] + "<br/> ");
Date. setMonth (date. getMonth () + 1); // month + 1 (1st day of next month)
Var LastDay = new Date (date-3600000*24); // day-1 (that is, the last day of the month)
Document. write (NowYear + "year" + NowMonth + "month total" + LastDay. getDate () + "day <br/> ");
Var Nowdate = ("2012-11-22"). split ("-"), // obtain a date
NowYear = parseInt (Nowdate [0]), // a year
NowMonth = parseInt (Nowdate [1]), // a month
Nowday = parseInt (Nowdate [2]), // one day
Date = new Date (),
Weekday = new Array (7 );
Weekday [0] = "Sunday ";
Weekday [1] = "Monday ";
Weekday [2] = "Tuesday ";
Weekday [3] = "weekday ";
Weekday [4] = "Thursday ";
Weekday [5] = "Friday ";
Weekday [6] = "Saturday ";
Date. setFullYear (NowYear); // set the current year to a certain year
Date. setMonth (NowMonth-1); // set the current month to a month
Date. setDate (Nowday); // set the current day to a certain day
Document. write (NowYear + "year" + NowMonth + "month" + Nowday + "is" + weekday [date. getDay ()] + "<br/> ");
Date. setDate (1); // set the current date to the first day of the month
Document. write (NowYear + "year" + NowMonth + "Month 1 is" + weekday [date. getDay ()] + "<br/> ");
Date. setMonth (date. getMonth () + 1); // month + 1 (1st day of next month)
Var LastDay = new Date (date-3600000*24); // day-1 (that is, the last day of the month)
Document. write (NowYear + "year" + NowMonth + "month total" + LastDay. getDate () + "day <br/> ");