CSharp examples for System:DateTime Format
Write Iso Date (Year-Month-Day)
using System.Text; using System.Globalization; using System.Collections.Specialized; using System.Collections; using System;/*from www . j a v a2s .c o m*/ public class Main{ /// <summary> /// Write Iso Date (Year-Month-Day) /// </summary> public static string WriteIsoDate( DateTime date ) { return date.Year + "-" + date.Month.ToString( "00" ) + "-" + date.Day.ToString( "00" ); } // WriteIsoDate(date) }