To String Year First - CSharp System

CSharp examples for System:DateTime Year

Description

To String Year First

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from   w  w  w .j  a v a2  s .co  m

public class Main{
        public static string ToStringYearFirst(this DateTime dt)     // year first format
    {
        return dt.ToString("yyyy-MM-dd HH:mm:ss");
    }
}

Related Tutorials