setMonth Summary Sets the month of the year for the System.Date object. Signatures Click on a signature to select it and view its documentation. public double setMonth(int month) public double setMonth(Month month) Usage public double setMonth(int month) public double setMonth(Month month) Returns The current time value of the System.Date object, which represents the difference in milliseconds from the updated date/time and 1 January 1970 00:00:00:00 UTC. The current time value of the System.Date object, which represents the difference in milliseconds from the updated date/time and 1 January 1970 00:00:00:00 UTC. Parameters month A zero-based integer value between 0 and 11 representing the months January to December. Parameters month A value of the System.Date.Month enumeration. Description Sets the month of the year for the System.Date object according to local time. Sets the month of the year for the System.Date object according to local time. Examples Basic Usage 123456import System; Date d = new Date(2011, Date.Month.FEB, 10, 5, 30, 59, 100);Console.log(d.getMonth()); // 1d.setMonth(11);Console.log(d.getMonth()); // 11 Basic Usage 123456import System; Date d = new Date(2011, Date.Month.FEB, 10, 5, 30, 59, 100);Console.log((Date.Month) d.getMonth() == Date.Month.FEB); // trued.setMonth(Date.Month.DEC);Console.log((Date.Month) d.getMonth() == Date.Month.DEC); // true Share HTML | BBCode | Direct Link