Creates a time span object, representing a given number of minutes. - CSharp System

CSharp examples for System:TimeSpan

Description

Creates a time span object, representing a given number of minutes.

Demo Code


using System.Globalization;
using System;/*  w ww .j  a  va 2 s .  c  o m*/

public class Main{
        /// <summary>
    ///   <para>Creates a time span object, representing a given number of minutes.</para>
    /// </summary>
    /// <param name="self">Number of minutes.</param>
    /// <returns>Time span instance.</returns>
    public static TimeSpan Minutes(this int self)
    {
      return new TimeSpan(0, self, 0);
    }
        /// <summary>
    ///   <para>Creates a time span object, representing a given number of minutes.</para>
    /// </summary>
    /// <param name="self">Number of minutes.</param>
    /// <returns>Time span instance.</returns>
    public static TimeSpan Minutes(this short self)
    {
      return new TimeSpan(0, self, 0);
    }
        /// <summary>
    ///   <para>Creates a time span object, representing a given number of minutes.</para>
    /// </summary>
    /// <param name="self">Number of minutes.</param>
    /// <returns>Time span instance.</returns>
    public static TimeSpan Minutes(this byte self)
    {
      return new TimeSpan(0, self, 0);
    }
}

Related Tutorials