System.Globalization.CCGregorianCalendar.ToDateTime C# (CSharp) Method

ToDateTime() public static method

A method that creates the T:System.DateTime from the parameters.
public static ToDateTime ( int year, int month, int day, int hour, int minute, int second, int milliseconds ) : System.DateTime
year int An integer that gives the year ///
month int An integer that specifies the month. ///
day int An integer that specifies the day. ///
hour int An integer that specifies the hour. ///
minute int An integer that specifies the minute. ///
second int An integer that gives the second. ///
milliseconds int An integer that gives the /// milliseconds. ///
return System.DateTime
	public static System.DateTime ToDateTime(int year, int month, int day,
		int hour, int minute, int second, int milliseconds)
	{
		return CCFixed.ToDateTime(fixed_from_dmy(day, month, year),
			hour, minute, second, milliseconds);
	}
} // class CCGregorianCalendar

Usage Example

Example #1
0
        /// <summary>Returns a <see cref="T:System.DateTime" /> that is set to the specified date and time in the specified era.</summary>
        /// <returns>The <see cref="T:System.DateTime" /> that is set to the specified date and time in the current era.</returns>
        /// <param name="year">An integer that represents the year. </param>
        /// <param name="month">An integer from 1 to 12 that represents the month. </param>
        /// <param name="day">An integer from 1 to 31 that represents the day. </param>
        /// <param name="hour">An integer from 0 to 23 that represents the hour. </param>
        /// <param name="minute">An integer from 0 to 59 that represents the minute. </param>
        /// <param name="second">An integer from 0 to 59 that represents the second. </param>
        /// <param name="millisecond">An integer from 0 to 999 that represents the millisecond. </param>
        /// <param name="era">An integer that represents the era. </param>
        /// <exception cref="T:System.ArgumentOutOfRangeException">
        ///   <paramref name="year" /> is outside the range supported by the calendar.-or- <paramref name="month" /> is outside the range supported by the calendar.-or- <paramref name="day" /> is outside the range supported by the calendar.-or- <paramref name="hour" /> is less than zero or greater than 23.-or- <paramref name="minute" /> is less than zero or greater than 59.-or- <paramref name="second" /> is less than zero or greater than 59.-or- <paramref name="millisecond" /> is less than zero or greater than 999.-or- <paramref name="era" /> is outside the range supported by the calendar. </exception>
        public override DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era)
        {
            int year2 = this.M_CheckYMDEG(year, month, day, ref era);

            base.M_CheckHMSM(hour, minute, second, millisecond);
            return(CCGregorianCalendar.ToDateTime(year2, month, day, hour, minute, second, millisecond));
        }
All Usage Examples Of System.Globalization.CCGregorianCalendar::ToDateTime