Get date string for JSON object. - CSharp System

CSharp examples for System:DateTime

Description

Get date string for JSON object.

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//w  w w . j a  v  a  2s.c o m

public class Main{
        /// <summary>Get date string for JSON object.</summary>
    public static string GetJsonDate(DateTime date)
    {
        return date.Year.ToString() + "/" + date.Month.ToString() + "/" + date.Day.ToString();
    }

}

Related Tutorials