CSharp examples for System:DateTime Convert
Converts from SqlServer min date to DateTime.MinValue if required.
using System;/*from w w w .jav a 2 s . c o m*/ public class Main{ /// <summary> /// Converts from SqlServer min date to <c>DateTime.MinValue</c> if required. /// </summary> /// <param name="dateTime">Date/Time in sqlServer</param> /// <returns>Proper .NET date</returns> public static DateTime ToSqlServer(this DateTime dateTime) { return dateTime == DateTime.MinValue ? new DateTime(1753, 1, 1) : dateTime; } }