To Custom Date String - CSharp System

CSharp examples for System:DateTime Format

Description

To Custom Date String

Demo Code


using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/* w  w  w .ja va2 s . c o m*/

public class Main{
        public static string ToCustomDateString(this DateTime date)
        {
            return date.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
        }
}

Related Tutorials