yyyy MMdd To String - CSharp System

CSharp examples for System:DateTime Format

Description

yyyy MMdd To String

Demo Code


using System.Globalization;
using System;/*from w w w.  jav  a  2 s . c  o  m*/

public class Main{
        // ReSharper disable once InconsistentNaming
        public static string yyyyMMddToString(string date)
        {
            DateTime theTime= DateTime.ParseExact(date,
                                        "yyyy-MM-dd",
                                        CultureInfo.InvariantCulture,
                                        DateTimeStyles.None);
            return theTime.ToString("dd/MM/yyyy");
        }
}

Related Tutorials