docs.unity3d.com
    Show / Hide Table of Contents

    Enum TimeSpanFormatOptions

    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)

    Namespace: UnityEngine.Localization.SmartFormat.Utilities
    Syntax
    public enum TimeSpanFormatOptions : int

    Fields

    Name Description Value
    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"

    InheritDefaults

    Specifies that all timeSpanFormatOptions should be inherited from TimeSpanUtility.DefaultTimeFormatOptions.

    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.

    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.

    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.

    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.

    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.

    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.

    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.

    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"

    TruncateShortest

    Displays the highest non-zero value within the range.

    Example: "00.23:00:59.000" = "23 hours"

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023