Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class NodaTime.​Extensions.​TimeSpanExtensions
Assembly: NodaTime
Inheritance: object → TimeSpanExtensions
Extension methods for <see cref="T:System.TimeSpan" /> .
Methods
public static
Duration
ToDuration​(System.​TimeSpan timeSpan)
Converts a <see cref="T:System.TimeSpan" /> into a <see cref="T:NodaTime.Duration" /> .
Returns A <c>Duration</c> representing the same length of time as <paramref name="timeSpan" /> .
timeSpan
The <c>TimeSpan</c> to convert.
Remarks
This is a convenience method which calls <see cref="M:NodaTime.Duration.FromTimeSpan(System.TimeSpan)" /> .
public static
Offset
ToOffset​(System.​TimeSpan timeSpan)
Converts a <see cref="T:System.TimeSpan" /> into an <see cref="T:NodaTime.Offset" /> .
Returns An <c>Offset</c> representing the same length of time as <paramref name="timeSpan" /> .
timeSpan
The <c>TimeSpan</c> to convert.
Remarks
This is a convenience method which calls <see cref="M:NodaTime.Offset.FromTimeSpan(System.TimeSpan)" /> .
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object