CSharp examples for System:DateTime Year
DateTime From Year Month Day
using System;/*www. jav a 2 s .c om*/ public class Main{ public static DateTime? FromYearMonthDay(int year, int month, int day) { if (month > 12 || month < 1 || day > 31 || day < 1) return null; try { return new DateTime(year, month, day); } catch { return null; } } }