CSharp examples for System:DateTime Parse
String As Date Time
using System;/* ww w. j av a2 s. co m*/ public class Main{ public static DateTime AsDateTime( this string str, DateTime defaultValue = default(DateTime)) { DateTime value; return DateTime.TryParse(str, out value) ? value : defaultValue; } }