CSharp examples for System:DateTime Year
To String Year First
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"); } }