get datetime day month year format - CSharp System

CSharp examples for System:DateTime Year

Description

get datetime day month year format

Demo Code


using System.Globalization;
using System;//from   ww w . j a  v  a2s.co m

public class Main{
        /// <summary>
        /// get datetime day month year format
        /// </summary>
        /// <param name="date">Date</param>
        /// <returns>string format of date</returns>
        public static string DayMonthYear(this DateTime date)
        {
            return String.Format("{0:MM/dd/yyyy}", date);
        }
}

Related Tutorials