static public DateTime ToDateTime(string value) { try { return XmlConvert.ToDateTime(value, XmlDateTimeSerializationMode.RoundtripKind); } catch (ArgumentException exception) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "DateTime", exception)); } catch (FormatException exception) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "DateTime", exception)); } }
public DateTime ToDateTime() { if (_type == ValueHandleType.DateTime) { return(XmlConverter.ToDateTime(GetInt64())); } if (_type == ValueHandleType.UTF8) { return(XmlConverter.ToDateTime(_bufferReader.Buffer, _offset, _length)); } return(XmlConverter.ToDateTime(GetString())); }