To Year Month Day Format - CSharp System

CSharp examples for System:DateTime Year

Description

To Year Month Day Format

Demo Code

// Copyright (c) Microsoft Corporation. All rights reserved. 
using System;/*from w  w  w  .j a v  a2 s .  c o m*/

public class Main{
        public static string ToYearMonthDayFormat(this DateTime dateTime)
        {
            return dateTime.ToString("yyyy-MM-dd");
        }
}

Related Tutorials