BUG: TimeSpan.ToString() does not localize the result.

TimeSpan.ToString() always returns the same format, regardless of region settings. For example, if it returns

   10:30:25

on an English server, it will return exactly the same thing on an Italian server. However, in Italy they use periods in times so the result should be

   10.30.25

Thanks,
   Mike

MikeS at Silect dot com


Answer this question

BUG: TimeSpan.ToString() does not localize the result.

  • JoeM

    I wouldn't call this a bug since the TimeSpan type behaves exactly as documented.

    If you prefer to use the current culture's time separator you can format the timespan value that way yourself. Use CultureInfo.DateTimeFormat.TimeSeparator. But note that the time separator is defined for use with time values, not timespan values. They are conceptually different.


  • BUG: TimeSpan.ToString() does not localize the result.