To Custom Date Time String - CSharp System

CSharp examples for System:DateTime Format

Description

To Custom Date Time String

Demo Code


using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*  ww w  .jav  a2s  . c  o  m*/

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

Related Tutorials