docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TimeSpanConverter

    UXML attribute converter for TimeSpan values, used by TimeField and TimePicker to express a time of day such as 09:30 or 09:30:00.

    Inheritance
    object
    UxmlAttributeConverter<TimeSpan>
    TimeSpanConverter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.Editor
    Assembly: Unity.AppUI.Editor.dll
    Syntax
    public class TimeSpanConverter : UxmlAttributeConverter<TimeSpan>

    Methods

    FromString(string)

    Converts a UXML attribute value into a TimeSpan.

    Declaration
    public override TimeSpan FromString(string value)
    Parameters
    Type Name Description
    string value

    The attribute value to convert.

    Returns
    Type Description
    TimeSpan

    The converted time span, or zero if the value is empty or cannot be parsed.

    Overrides
    UxmlAttributeConverter<TimeSpan>.FromString(string)

    ToString(TimeSpan)

    Converts a TimeSpan into its UXML attribute representation.

    Declaration
    public override string ToString(TimeSpan value)
    Parameters
    Type Name Description
    TimeSpan value

    The time span to convert.

    Returns
    Type Description
    string

    The time span formatted using the invariant culture.

    Overrides
    UxmlAttributeConverter<TimeSpan>.ToString(TimeSpan)
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)