I\'m trying to generate timestamp for cXML as shown below. Is there any function in C# which I can use to format date time to: 2011-06-09T16:37:17+16:37
e.g.
Yes, using DateTime.ToString("s"), see this link: Standard Date and Time Format Strings. Be aware that "s" does not include the timezone information, whereas "o" does include both fractional seconds and timezone.
You can also use the XmlConvert.ToString method, where you can specify the time zone information as well.