TimeSpan

Shows the time interval.

# Properties

[{"index":"int32 Days","0":"TimeSpan's day component."}]

[{"index":"integer Elapsed","0":"An integer in milliseconds, which composes TimeSpan."}]

[{"index":"int32 Hours","0":"TimeSpan's time component."}]

[{"index":"int32 Milliseconds","0":"TimeSpan's millisecond component."}]

[{"index":"int32 Minutes","0":"TimeSpan's minute component."}]

[{"index":"int32 Seconds","0":"TimeSpan's second component."}]

[{"index":"number TotalDays (ReadOnly)","0":"Shows the total days of TimeSpan."}]

[{"index":"number TotalHours (ReadOnly)","0":"Shows the total hours of TimeSpan."}]

[{"index":"integer TotalMilliseconds (ReadOnly)","0":"Shows the total milliseconds of TimeSpan."}]

[{"index":"number TotalMinutes (ReadOnly)","0":"Shows the total minutes of TimeSpan."}]

[{"index":"number TotalSeconds (ReadOnly)","0":"Shows the total seconds of TimeSpan."}]

[{"index":"TimeSpan MaxValue (Static) (ReadOnly)","0":"Shows the maximum TimeSpan value."}]

[{"index":"TimeSpan MinValue (Static) (ReadOnly)","0":"Shows the minimum TimeSpan value."}]

[{"index":"TimeSpan Zero (Static) (ReadOnly)","0":"Shows the TimeSpan value having a 00:00:00 value."}]

# Constructors

[{"index":"TimeSpan(int32 hours, int32 minutes, int32 seconds)","0":"Initializes to the designated hour, minute, and second."}]

[{"index":"TimeSpan(int32 days, int32 hours, int32 minutes, int32 seconds)","0":"Initializes to the designated day, hour, minute, and second."}]

[{"index":"TimeSpan(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds)","0":"Initializes to the designated day, hour, minute, second, and millisecond."}]

[{"index":"TimeSpan(integer elapsed)","0":"Initializes to an integer in milliseconds."}]

[{"index":"TimeSpan(string timeSpanString)","0":"Initializes to the string for the designated time."}]

[{"index":"TimeSpan(string timeSpanString, string format)","0":"Initializes to the string for the designated time. The string format must exactly match the designated format. The TimeSpan format specifier can be included in the format."}]

[{"index":"TimeSpan(string timeSpanString, string format, string cultureName)","0":"Initializes the string to the designated time. The string format must exactly match the designated format. The TimeSpan format specifier can be included in the format."}]

# Methods

[{"index":"TimeSpan Duration()","0":"Creates TimeSpan with the absolute value of the entity and then returns it."}]

[{"index":"TimeSpan Negate()","0":"Creates TimeSpan with the negated value of the entity and then returns it."}]

[{"index":"string ToFormattedString(string format)","0":"Converts TimeSpan into a string and returns it. The standard TimeSpan format specifier and custom TimeSpan format specifier can be included in the format."}]

[{"index":"string ToFormattedString(string format, string cultureName)","0":"Converts TimeSpan into a string and returns it. The standard TimeSpan format specifier and custom TimeSpan format specifier can be included in the format. cultureName is a cultural area name, and it follows the standards defined in BCP 47."}]

[{"index":"TimeSpan FromDays(number value) (Static)","0":"Creates TimeSpan representing the number of designated days and then returns it. The designated value will be rounded off in milliseconds."}]

[{"index":"TimeSpan FromHours(number value) (Static)","0":"Creates TimeSpan representing the designated hours and then returns it. The designated value will be rounded off in milliseconds."}]

[{"index":"TimeSpan FromMilliseconds(integer value) (Static)","0":"Creates TimeSpan representing the designated milliseconds and then returns it."}]

[{"index":"TimeSpan FromMinutes(number value) (Static)","0":"Creates TimeSpan representing the designated minutes and then returns it. The designated value will be rounded off in milliseconds."}]

[{"index":"TimeSpan FromSeconds(number value) (Static)","0":"Creates TimeSpan representing the designated seconds and then returns it. The designated value will be rounded off in milliseconds."}]

# Operators

[{"index":"TimeSpan Addition(TimeSpan left, TimeSpan right) (Static)","0":"Returns a new TimeSpan value obtained by adding the two specified values together."}]

[{"index":"boolean Equality(TimeSpan left, TimeSpan right) (Static)","0":"Checks if the two values are the same."}]

[{"index":"boolean GreaterThan(TimeSpan left, TimeSpan right) (Static)","0":"Checks if the specified left value is greater than the right value."}]

[{"index":"boolean GreaterThanOrEqual(TimeSpan left, TimeSpan right) (Static)","0":"Checks if the specified left value is greater than or equal to the right value."}]

[{"index":"boolean Inequality(TimeSpan left, TimeSpan right) (Static)","0":"Checks if the two values are different."}]

[{"index":"boolean LessThan(TimeSpan left, TimeSpan right) (Static)","0":"Checks if the specified left value is less than the right value."}]

[{"index":"boolean LessThanOrEqual(TimeSpan left, TimeSpan right) (Static)","0":"Checks if the specified left value is less than or equal to the right value."}]

[{"index":"TimeSpan Subtraction(TimeSpan left, TimeSpan right) (Static)","0":"Returns a new TimeSpan value by subtracting the specified right value from the left value."}]

[{"index":"TimeSpan UnaryNegation(TimeSpan value) (Static)","0":"Returns a new TimeSpan value that is the negated value of the specified value."}]

# SeeAlso

  * [Expressing Time with TimeSpan](/docs?postId=689)