Date To Display string - CSharp System

CSharp examples for System:DateTime Convert

Description

Date To Display string

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*w  w  w. jav  a 2  s  .  co m*/

public class Main{
        public static string DateToDisp(string date)
        {
            string[] dateString = new string[3];
            DateTime dt = Convert.ToDateTime(date);
            dateString = dt.ToString("dd MMM yyyy").Split(Convert.ToChar(" "));
            return dateString[0] + " " + dateString[1] + ", " + dateString[2];
        }
}

Related Tutorials