CSharp examples for System:DateTime Day
Creates a time span object, representing a given number of days.
using System.Globalization; using System;/*from www. ja v a 2 s . c o m*/ public class Main{ /// <summary> /// <para>Creates a time span object, representing a given number of days.</para> /// </summary> /// <param name="self">Number of days.</param> /// <returns>Time span instance.</returns> public static TimeSpan Days(this int self) { return new TimeSpan(self, 0, 0, 0); } /// <summary> /// <para>Creates a time span object, representing a given number of days.</para> /// </summary> /// <param name="self">Number of days.</param> /// <returns>Time span instance.</returns> public static TimeSpan Days(this short self) { return new TimeSpan(self, 0, 0, 0); } /// <summary> /// <para>Creates a time span object, representing a given number of days.</para> /// </summary> /// <param name="self">Number of days.</param> /// <returns>Time span instance.</returns> public static TimeSpan Days(this byte self) { return new TimeSpan(self, 0, 0, 0); } }