To Month Year - CSharp System

CSharp examples for System:DateTime Year

Description

To Month Year

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//w w w.  j a  va 2  s.  c  om

public class Main{
        public static string ToMonthYear(this DateTime value, string format = "MM/yyyy")
        {
            return value.ToString(format);
        }
}

Related Tutorials