C# 클래스 SmartFormat.Utilities.TimeSpanUtility

파일 보기 프로젝트 열기: scottrippey/SmartFormat.NET

공개 메소드들

메소드 설명
Ceiling ( this FromTime, long intervalTicks ) : System.TimeSpan

Returns the smallest TimeSpan greater than or equal to the specified interval.

For example: Ceiling("00:57:00", TimeSpan.TicksPerMinute * 5) => "01:00:00"

Floor ( this FromTime, long intervalTicks ) : System.TimeSpan

Returns the largest TimeSpan less than or equal to the specified interval.

For example: Floor("00:57:00", TimeSpan.TicksPerMinute * 5) => "00:55:00"

Round ( this FromTime, long intervalTicks ) : System.TimeSpan

Returns the TimeSpan closest to the specified interval.

For example: Round("00:57:00", TimeSpan.TicksPerMinute * 5) => "00:55:00"

ToTimeString ( this FromTime, TimeSpanFormatOptions options, TimeTextInfo timeTextInfo ) : string

Turns a TimeSpan into a human-readable text.

Uses the specified timeSpanFormatOptions.

For example: "31.23:59:00.555" = "31 days 23 hours 59 minutes 0 seconds 555 milliseconds"

비공개 메소드들

메소드 설명
TimeSpanUtility ( ) : System

메소드 상세

Ceiling() 공개 정적인 메소드

Returns the smallest TimeSpan greater than or equal to the specified interval.

For example: Ceiling("00:57:00", TimeSpan.TicksPerMinute * 5) => "01:00:00"

public static Ceiling ( this FromTime, long intervalTicks ) : System.TimeSpan
FromTime this A TimeSpan to be rounded.
intervalTicks long Specifies the interval for rounding. Use TimeSpan.TicksPer____.
리턴 System.TimeSpan

Floor() 공개 정적인 메소드

Returns the largest TimeSpan less than or equal to the specified interval.

For example: Floor("00:57:00", TimeSpan.TicksPerMinute * 5) => "00:55:00"

public static Floor ( this FromTime, long intervalTicks ) : System.TimeSpan
FromTime this A TimeSpan to be rounded.
intervalTicks long Specifies the interval for rounding. Use TimeSpan.TicksPer____.
리턴 System.TimeSpan

Round() 공개 정적인 메소드

Returns the TimeSpan closest to the specified interval.

For example: Round("00:57:00", TimeSpan.TicksPerMinute * 5) => "00:55:00"

public static Round ( this FromTime, long intervalTicks ) : System.TimeSpan
FromTime this A TimeSpan to be rounded.
intervalTicks long Specifies the interval for rounding. Use TimeSpan.TicksPer____.
리턴 System.TimeSpan

ToTimeString() 공개 정적인 메소드

Turns a TimeSpan into a human-readable text.

Uses the specified timeSpanFormatOptions.

For example: "31.23:59:00.555" = "31 days 23 hours 59 minutes 0 seconds 555 milliseconds"

public static ToTimeString ( this FromTime, TimeSpanFormatOptions options, TimeTextInfo timeTextInfo ) : string
FromTime this
options TimeSpanFormatOptions /// A combination of flags that determine the formatting options. /// These will be combined with the default timeSpanFormatOptions. ///
timeTextInfo TimeTextInfo An object that supplies the text to use for output
리턴 string