Get yesterday. - CSharp System

CSharp examples for System:DateTime Day

Description

Get yesterday.

Demo Code


using System.Globalization;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from   ww w.j a  v  a2s. com

public class Main{
        /// <summary>
        /// Get yesterday.
        /// </summary>
        /// <returns></returns>
        public static DateTime GetYesterday()
        {
            return DateTime.Today.AddDays(-1);
        }
}

Related Tutorials