private static string ConvertDateTimeVersit(string text) { // check if text is in date format DateTime date; if (XDocUtil.TryParseXmlDateTime(text, out date)) { text = date.ToUniversalTime().ToString("yyyyMMdd\\THHmmssZ"); } return(text); }
private static string EncodeString(string text) { // check if text is in date format DateTime date; if (XDocUtil.TryParseXmlDateTime(text, out date)) { // convert text to RFC1123 formatted date text = date.ToUniversalTime().ToString("R"); } // escape any special characters return("\"" + EscapeString(text) + "\""); }