Converts the supplied DateTimeOffset to a String. : XML Convert « XML LINQ « C# / C Sharp






Converts the supplied DateTimeOffset to a String.

 

using System;
using System.Xml;

class Example
{
    static void Main()
    {
        DateTimeOffset dto;
        dto = DateTimeOffset.Now;

        string timeAsString = XmlConvert.ToString(dto);
        Console.WriteLine(timeAsString);
    }
}

   
  








Related examples in the same category

1.Decodes a name. This method does the reverse of the EncodeName and EncodeLocalName methods.
2.Converts the supplied String to a DateTimeOffset equivalent.
3.Converts the DateTime to a String.
4.Converts the supplied DateTimeOffset to a String in the specified format.
5.Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation.
6.Verify Xml Chars