This document is archived and information here might be outdated.  Recommended version.


IXMLReader.ReadDate Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (System)  

IXMLReader.ReadDate Method

Reads the current element value as a date.

[Visual Basic .NET]
Public Function ReadDate ( _
) As DateTime
[C#]
public DateTime ReadDate (
);
[C++]
HRESULT ReadDate(
  DATE* Value
);
[C++]

Parameters Value [out, retval] Value is a parameter of type DATE

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The ReadDate method specifies the current element value as a date.
Date value in xml file should be only of this format:
2005-01-28T12:17:58
otherwise the ReadDate will invoke Invalid Procedure Call Error.

Example of "data.xml" file:

<?xml version="1.0"?>
<Data description="example of ReadDate">
  <type>
    <date>2005-01-28T12:23:34</date>

  </type>

</Data>

 

VB6 code to get date value:

Dim pXMLStream As IXMLStream
Set pXMLStream=New XMLStream
  
pXMLStream.LoadFromFile App.Path + "\data.xml"

pXMLReader.OpenElement
pXMLReader.OpenElement

Dim dateValue As Date
dateValue=pXMLReader.ReadDate

See Also

IXMLReader Interface