Skip to content

TimeSpanConverter example is misleading, seems to suggest conversion from Ticks in string format, which is not correct #13135

Description

@m-rray

Type of issue

Other (describe below)

Description

Example states

Both variables are represented in Ticks format

before converting from "5000000" to a timespan. This seems to read that the conversion will parse from the tick value of a timespan back into a TimeSpan. This is not true, TypeDescriptor.GetConverter(ts).ConvertFrom(myTSStr) treats the string format as days resulting in "5000000.00:00:00", and throwing an overflow exception if you try and do it with ticks for any timespan more than about 1 second because of what that results in in terms of ticks.

This is wrong across multiple versions of the documentation.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.timespanconverter?view=net-10.0

Content source URL

https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.ComponentModel/TimeSpanConverter.xml

Document Version Independent Id

79d7390a-d984-7fc7-aa5e-baeba420fb84

Platform Id

04e77bb7-dad8-79b0-d531-8c44a26d9c5f

Article author

@dotnet-bot

Activity

  1. dotnet-policy-service commented on Oct 5, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-componentmodel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions