To Sql Date - CSharp System

CSharp examples for System:DateTime Format

Description

To Sql Date

Demo Code


using System;/*from w ww. j a va2s .c  o m*/

public class Main{
        public static string ToSqlDate(this DateTime? date)
        {
            return date == null ? null : date.Value.ToString("yyyy-MM-dd");
        }
}

Related Tutorials