Table of Contents

Class TimeSpanExtensions

Namespace
MADE.Data.Converters.Extensions
Assembly
MADE.Data.Converters.dll

Defines a collection of extensions for TimeSpan values.

public static class TimeSpanExtensions
Inheritance
TimeSpanExtensions
Inherited Members

Methods

ToHumanReadableString(TimeSpan)

Converts a TimeSpan to a human-readable string representation.

public static string ToHumanReadableString(this TimeSpan timeSpan)

Parameters

timeSpan TimeSpan

The time span to convert.

Returns

string

A human-readable string such as "2 hours 30 minutes" or "1 day 3 hours". Returns "0 seconds" for a zero time span.

TotalWeeks(TimeSpan)

Gets the total number of whole weeks represented by the TimeSpan.

public static int TotalWeeks(this TimeSpan timeSpan)

Parameters

timeSpan TimeSpan

The time span to convert.

Returns

int

The total number of whole weeks.