C# Class NSupport.TimeSpanDateTimeOffset

Provides extension methods for TimeSpan for DateTimeOffset conversion.
显示文件 Open project: jittuu/NSupport

Public Methods

Method Description
Ago ( this source ) : DateTimeOffset

Returns a DateTimeOffset which subtract current TimeSpan ago from now.

FromNow ( this source ) : DateTimeOffset

Returns a DateTimeOffset which add current TimeSpan since from now.

Since ( this source, DateTimeOffset time ) : DateTimeOffset

Returns a DateTimeOffset which add current TimeSpan since from the time.

Until ( this source, DateTimeOffset time ) : DateTimeOffset

Returns a DateTimeOffset which subtract current TimeSpan ago from the time.

Method Details

Ago() public static method

Returns a DateTimeOffset which subtract current TimeSpan ago from now.
public static Ago ( this source ) : DateTimeOffset
source this A instance.
return DateTimeOffset

FromNow() public static method

Returns a DateTimeOffset which add current TimeSpan since from now.
public static FromNow ( this source ) : DateTimeOffset
source this A instance.
return DateTimeOffset

Since() public static method

Returns a DateTimeOffset which add current TimeSpan since from the time.
public static Since ( this source, DateTimeOffset time ) : DateTimeOffset
source this A instance.
time DateTimeOffset A since from.
return DateTimeOffset

Until() public static method

Returns a DateTimeOffset which subtract current TimeSpan ago from the time.
public static Until ( this source, DateTimeOffset time ) : DateTimeOffset
source this A instance.
time DateTimeOffset A ago from.
return DateTimeOffset