Convert Date to XML Date/Time Format
Converting a date such as 1/21/2008 11:09:05 AM to XML Date/Time Format. You might want to put this code into a MapHelper library, then reference it from a Scripting Functoid in a BizTalk Map.
public static string ConvertDateTimetoXmlDateTime(string inDate)
{
try
{
DateTime dtIn = DateTime.Parse(inDate);
return System.Xml.XmlConvert.ToString(dtIn, System.Xml.XmlDateTimeSerializationMode.Local);
}
catch
{
return "invalid-Date/Time-conversion from value='" + inDate + "'";
}
}