C# Class System.TimeUtils

Datei anzeigen Open project: sapiens/cavemantools

Public Methods

Method Description
EnumerateTo ( this start, System.DateTime end ) : IEnumerable
IsSameMonthAs ( this date, System.DateTime otherDate ) : bool

Checks if both dates are days of the same month and year

MeasureTime ( System.Action action ) : System.TimeSpan
Multiply ( this duration, double modifier ) : System.TimeSpan
Multiply ( this duration, float modifier ) : System.TimeSpan

Multiplies a time period by a number

ToDays ( this value ) : System.TimeSpan
ToFirstDay ( this date ) : System.DateTime
ToHuman ( this time ) : string

Outputs the 'human friendly' format (ex: 4 days ago). English only

ToLastDayOfMonth ( this dt ) : System.DateTime
ToMiliseconds ( this value ) : System.TimeSpan
ToSeconds ( this value ) : System.TimeSpan

Method Details

EnumerateTo() public static method

public static EnumerateTo ( this start, System.DateTime end ) : IEnumerable
start this
end System.DateTime
return IEnumerable

IsSameMonthAs() public static method

Checks if both dates are days of the same month and year
public static IsSameMonthAs ( this date, System.DateTime otherDate ) : bool
date this
otherDate System.DateTime
return bool

MeasureTime() public static method

public static MeasureTime ( System.Action action ) : System.TimeSpan
action System.Action
return System.TimeSpan

Multiply() public static method

public static Multiply ( this duration, double modifier ) : System.TimeSpan
duration this
modifier double
return System.TimeSpan

Multiply() public static method

Multiplies a time period by a number
public static Multiply ( this duration, float modifier ) : System.TimeSpan
duration this
modifier float
return System.TimeSpan

ToDays() public static method

public static ToDays ( this value ) : System.TimeSpan
value this
return System.TimeSpan

ToFirstDay() public static method

public static ToFirstDay ( this date ) : System.DateTime
date this
return System.DateTime

ToHuman() public static method

Outputs the 'human friendly' format (ex: 4 days ago). English only
public static ToHuman ( this time ) : string
time this
return string

ToLastDayOfMonth() public static method

public static ToLastDayOfMonth ( this dt ) : System.DateTime
dt this
return System.DateTime

ToMiliseconds() public static method

public static ToMiliseconds ( this value ) : System.TimeSpan
value this
return System.TimeSpan

ToSeconds() public static method

public static ToSeconds ( this value ) : System.TimeSpan
value this
return System.TimeSpan