Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

TimeSpanFormatOptions

enumeration

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description


Determines all options for time formatting.

This one value actually contains 4 settings:

Abbreviate / AbbreviateOff

LessThan / LessThanOff

Truncate   Auto / Shortest / Fill / Full

Range   MilliSeconds / Seconds / Minutes / Hours / Days / Weeks (Min / Max)

Properties

Property Description
None Specifies that all timeSpanFormatOptions should be inherited from TimeSpanUtility.DefaultTimeFormatOptions.
Abbreviate Abbreviates units. Example: "1d 2h 3m 4s 5ms"
AbbreviateOff Does not abbreviate units. Example: "1 day 2 hours 3 minutes 4 seconds 5 milliseconds"
LessThan Displays "less than 1 (unit)" when the TimeSpan is smaller than the minimum range.
LessThanOff Displays "0 (units)" when the TimeSpan is smaller than the minimum range.
TruncateShortest Displays the highest non-zero value within the range.Example: "00.23:00:59.000" = "23 hours"
TruncateAuto Displays all non-zero values within the range.Example: "00.23:00:59.000" = "23 hours 59 minutes"
TruncateFill Displays the highest non-zero value and all lesser values within the range.Example: "00.23:00:59.000" = "23 hours 0 minutes 59 seconds 0 milliseconds"
TruncateFull Displays all values within the range.Example: "00.23:00:59.000" = "0 days 23 hours 0 minutes 59 seconds 0 milliseconds"
RangeMilliSeconds Determines the range of units to display.You may combine two values to form the minimum and maximum for the range. Example: (RangeMinutes) defines a range of Minutes only; (RangeHours | RangeSeconds) defines a range of Hours to Seconds.
RangeSeconds Determines the range of units to display.You may combine two values to form the minimum and maximum for the range. Example: (RangeMinutes) defines a range of Minutes only; (RangeHours | RangeSeconds) defines a range of Hours to Seconds.
RangeMinutes Determines the range of units to display.You may combine two values to form the minimum and maximum for the range. Example: (RangeMinutes) defines a range of Minutes only; (RangeHours | RangeSeconds) defines a range of Hours to Seconds.
RangeHours Determines the range of units to display.You may combine two values to form the minimum and maximum for the range. Example: (RangeMinutes) defines a range of Minutes only; (RangeHours | RangeSeconds) defines a range of Hours to Seconds.
RangeDays Determines the range of units to display.You may combine two values to form the minimum and maximum for the range. Example: (RangeMinutes) defines a range of Minutes only; (RangeHours | RangeSeconds) defines a range of Hours to Seconds.
RangeWeeks Determines the range of units to display.You may combine two values to form the minimum and maximum for the range. Example: (RangeMinutes) defines a range of Minutes only; (RangeHours | RangeSeconds) defines a range of Hours to Seconds.