Will give you the DateTime object given the number of minutes you go forward. - CSharp System

CSharp examples for System:DateTime Minute

Description

Will give you the DateTime object given the number of minutes you go forward.

Demo Code


using System;/*  ww w  . j a v  a  2  s  .co  m*/

public class Main{
        /// <summary>
        /// Will give you the DateTime object given the number of minutes you go forward.
        /// </summary>
        /// <param name="minutes">
        /// The days.
        /// </param>
        /// <returns>
        /// DateTime object
        /// </returns>
        public static DateTime MinutesFromNow(this int minutes)
        {
            var t = new TimeSpan(0, minutes, 0);
            return DateTime.Now.Add(t);
        }
}

Related Tutorials