Api Date To String - CSharp System

CSharp examples for System:DateTime Parse

Description

Api Date To String

Demo Code


using System.Globalization;
using System;/*from www. jav a  2s  .  co m*/

public class Main{
        public static string ApiDateToString(string apiDate)
        {
            var dt = DateTime.ParseExact(apiDate, "MM/dd/yyyy HH:mm:ss", CultureInfo.InvariantCulture);
            return dt.ToString("dd/MM/yyyy");
        }
}

Related Tutorials