System.Xml.XmlConvert.ToString Method

Converts the TimeSpan to a string.

Syntax

public static string ToString (TimeSpan value)

Parameters

value
The value to convert.

Returns

A string representation of the TimeSpan.

Remarks

Documentation for this section has not yet been entered.

Example

The following example converts a TimeSpan to a string and writes the result to the console.

C# Example

using System;
using System.Xml;

public class App {

  public static void Main() {

    TimeSpan timeSpan = new TimeSpan(3, 11, 59, 6, 128);
    Console.WriteLine( "{0}",
      XmlConvert.ToString(timeSpan) );
  }
}

The output is

P3DT11H59M6.128S

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0