Get Short Year - CSharp System

CSharp examples for System:DateTime Year

Description

Get Short Year

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System;/*from  w ww. j  a v a 2s.c  o m*/

public class Main{
        public static string GetShortYear(this DateTime date)
        {
            return date.Year.ToString().Substring(2);
        }
}

Related Tutorials