CSharp examples for System:DateTime
Convert String Value to Date Value Or Null
using System.Text; using System.IO;/*from w ww.jav a2s . c o m*/ using System.Globalization; using System.Collections.Generic; using System; public class Main{ public static System.DateTime? DateValueOrNull(this string value) { System.DateTime result; if (System.DateTime.TryParse(value, out result)) { return result; } else { return null; } } }