XML date and time are in the format
\'-\'? yyyy \'-\' mm \'-\' dd \'T\' hh \':\' mm \':\' ss (\'.\' s+)? (zzzzzz)?
were
•\'-\'? yy
Delphi has a XSBuiltIns unit (since Delphi 6) that contains data types that can help you convert some XML data types:
(there are more, like TXSDecimal, you get the idea)
All of these contain at least these two methods:
You can use it like this:
with TXSDateTime.Create() do
try
AsDateTime := ClientDataSetParam.AsDateTime; // convert from TDateTime
Attribute.DateTimeValue := NativeToXS; // convert to WideString
finally
Free;
end;
with TXSDateTime.Create() do
try
XSToNative(XmlAttribute.DateTimeValue); // convert from WideString
CurrentField.AsDateTime := AsDateTime; // convert to TDateTime
finally
Free;
end;
That should get you going.
--jeroen