Date (Constructor) Summary Constructs a System.Date object. Signatures Click on a signature to select it and view its documentation. public Date() public Date() public Date(double milliseconds) public Date(int year, Month month) public Date(int year, Month month, int dayOfMonth) public Date(int year, Month month, int dayOfMonth, int hour) public Date(int year, Month month, int dayOfMonth, int hour, int minute) public Date(int year, Month month, int dayOfMonth, int hour, int minute, int second) public Date(int year, Month month, int dayOfMonth, int hour, int minute, int second, int millisecond) public Date(int year, int month) public Date(int year, int month, int dayOfMonth) public Date(int year, int month, int dayOfMonth, int hour) public Date(int year, int month, int dayOfMonth, int hour, int minute) public Date(int year, int month, int dayOfMonth, int hour, int minute, int second) public Date(int year, int month, int dayOfMonth, int hour, int minute, int second, int millisecond) Usage public Date() public Date() public Date(double milliseconds) public Date(int year, Month month) public Date(int year, Month month, int dayOfMonth) public Date(int year, Month month, int dayOfMonth, int hour) public Date(int year, Month month, int dayOfMonth, int hour, int minute) public Date(int year, Month month, int dayOfMonth, int hour, int minute, int second) public Date(int year, Month month, int dayOfMonth, int hour, int minute, int second, int millisecond) public Date(int year, int month) public Date(int year, int month, int dayOfMonth) public Date(int year, int month, int dayOfMonth, int hour) public Date(int year, int month, int dayOfMonth, int hour, int minute) public Date(int year, int month, int dayOfMonth, int hour, int minute, int second) public Date(int year, int month, int dayOfMonth, int hour, int minute, int second, int millisecond) Parameters milliseconds Milliseconds elapsed since 1 January, 1970 00:00:00:00. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. hour The hour to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. hour The hour to initialize the System.Date object to. minute The minute to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. hour The hour to initialize the System.Date object to. minute The minute to initialize the System.Date object to. second The second to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. hour The hour to initialize the System.Date object to. minute The minute to initialize the System.Date object to. second The second to initialize the System.Date object to. millisecond The millisecond to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. hour The hour to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. hour The hour to initialize the System.Date object to. minute The minute to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. hour The hour to initialize the System.Date object to. minute The minute to initialize the System.Date object to. second The second to initialize the System.Date object to. Parameters year The year to initialize the System.Date object to. month The month to initialize the System.Date object to. dayOfMonth The day of the month to initialize the System.Date object to. hour The hour to initialize the System.Date object to. minute The minute to initialize the System.Date object to. second The second to initialize the System.Date object to. millisecond The millisecond to initialize the System.Date object to. Description Constructs a System.Date object initialized to the current system time. Constructs a System.Date object initialized to the specified time in milliseconds. The specified milliseconds represents the milliseconds elapsed since 1 January, 1970 00:00:00:00. Constructs a System.Date object initialized to the specified month and year. Constructs a System.Date object initialized to the specified day, month, and year. Constructs a System.Date object initialized to the specified hour, day, month, and year. Constructs a System.Date object initialized to the specified minute, hour, day, month, and year. Constructs a System.Date object initialized to the specified second, minute, hour, day, month, and year. Constructs a System.Date object initialized to the specified millisecond, second, minute, hour, day, month, and year. Constructs a System.Date object initialized to the specified month and year. Constructs a System.Date object initialized to the specified day, month, and year. Constructs a System.Date object initialized to the specified hour, day, month, and year. Constructs a System.Date object initialized to the specified minute, hour, day, month, and year. Constructs a System.Date object initialized to the specified second, minute, hour, day, month, and year. Constructs a System.Date object initialized to the specified millisecond, second, minute, hour, day, month, and year. Examples Basic Usage 123import System; Date d = new Date(); Basic Usage 123import System; Date d = new Date(1000); Basic Usage 1234import System; Date d1 = new Date(2007, Date.Month.MAR); // March 2007Date d2 = new Date(2007, Date.Month.APR); // April 2007 Basic Usage 123import System; Date d1 = new Date(1989, Date.Month.MAY, 13); // 13 May, 1989 Basic Usage 123import System; Date d1 = new Date(1989, Date.Month.MAY, 13, 13); // 13 May, 1989 13:00 Basic Usage 123import System; Date d1 = new Date(1989, Date.Month.MAY, 13, 13, 30); // 13 May, 1989 13:30 Basic Usage 123import System; Date d1 = new Date(1989, Date.Month.MAY, 13, 13, 30, 10); // 13 May, 1989 13:30:10 Basic Usage 123import System; Date d1 = new Date(1989, Date.Month.MAY, 13, 13, 30, 10); // 13 May, 1989 13:30:10 Basic Usage 1234import System; Date d1 = new Date(2007, 2); // March 2007Date d2 = new Date(2007, 3); // April 2007 Basic Usage 123import System; Date d1 = new Date(1989, 4, 13); // 13 May, 1989 Basic Usage 123import System; Date d1 = new Date(1989, 4, 13, 13); // 13 May, 1989 13:00 Basic Usage 123import System; Date d1 = new Date(1989, 4, 13, 13, 30); // 13 May, 1989 13:30 Basic Usage 123import System; Date d1 = new Date(1989, 4, 13, 13, 30, 10); // 13 May, 1989 13:30:10 Basic Usage 123import System; Date d1 = new Date(1989, 4, 13, 13, 30, 10); // 13 May, 1989 13:30:10 Share HTML | BBCode | Direct Link