This project has moved and is read-only. For the latest updates, please go here.

System.TimeSpan extension methods

Ago()

Summary: Returns the Current DateTime with the specified TimeSpan subtracted from it.
C# Example:
var timeSpan = 7.Days()
var dt = timeSpan.Ago();

FromNow()

Summary: Returns the Current DateTime with the specified TimeSpan added to it.
C# Example:
var timeSpan = 7.Days();
var dt = timeSpan.FromNow();

UtcAgo()

Summary: Returns the Current Coordinated Universal Time (UTC) with the specified TimeSpan subtracted from it.
C# Example:
var dt = 7.Days().UtcAgo();

UtcFromNow()

Summary: Returns the Current Coordinated Universal Time (UTC) with the specified TimeSpan added to it.
C# Example:
var dt = 7.Days.UtcFromNow();

Last edited May 4, 2012 at 3:10 PM by crpietschmann, version 2

Comments

No comments yet.