Class TimeSpanEx
Class containing some extension methods for System.TimeSpan.
Inheritance
System.Object
TimeSpanEx
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:Extend
Assembly:Extend.dll
Syntax
public static class TimeSpanEx
Methods
| Improve this Doc View SourceFuture(TimeSpan)
Adds the given time span to the current date time.
Declaration
public static DateTime Future(this TimeSpan timeSpan)
Parameters
| Type | Name | Description |
|---|---|---|
| System.TimeSpan | timeSpan | The time span to add. |
Returns
| Type | Description |
|---|---|
| System.DateTime | Returns the current date time with the specified time span added to it. |
Past(TimeSpan)
Subtracts the specified time span to the current date time.
Declaration
public static DateTime Past(this TimeSpan timeSpan)
Parameters
| Type | Name | Description |
|---|---|---|
| System.TimeSpan | timeSpan | The time span to subtract. |
Returns
| Type | Description |
|---|---|
| System.DateTime | Returns the current date time with the specified time span subtracted from it. |