Skip to content

Support more formats in json TimeOnlyConverter #83863

@rofenix2

Description

@rofenix2

Hi, i expected that System.Text.Json.Serialization.Converters.TimeOnlyConverter internally used "TimeOnly.Parse", since trying to parse "19:00" (without seconds) is valid input and one that is frequently used, the same as "7:00 PM" that is the output of TimeOnly.ToShortTimeString(). But neither of them works when trying to deserialize, i think TimeOnlyConverter needs to be a little more consistent with the formats supported by TimeOnly.

internal sealed class TimeOnlyConverter : JsonPrimitiveConverter<TimeOnly>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions