CSharp examples for System:DateTime Format
Get Valid Date from String
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;//w w w.j a v a 2s. c o m public class Main{ public static DateTime GetValidDate(this string value) { DateTime temp; if (DateTime.TryParse(value, out temp)) return temp; return new DateTime(1900, 1, 1); } }