Re: MS SQL Server DateTime Type

At 01:32 01/09/27 -0400, Sean Gerety wrote:
>Thanks all for answers to my nillable question.  I now have a question
>regarding DateTime Datatypes.  As the current spec states a valid
>DateTime DataType would appear in an instance document like so.
>
><validDateTime>2001-08-02T17:30:00</validDateTime>
>
>How would one create a MS SQL Server DateTime?  The only thing that I
>can think of is to use a facet.  Any thoughts?
>
><validSQLServerDateTime>8/2/2001 5:30:00 PM</validSQLServerDateTime>

Hello Sean,

You can't do that in XML Schema, because it would be very
difficult to describe all the various date formats used
around the world with facets. What you can do are two things:

- Convert from MS SQL format to XML Schema format, and use that.
- Use the following kind of markup:

  <yourDateTime value='2001-08-02T17:30:00'>8/2/2001 5:30:00 PM</yourDateTime>

Both of these solutions will be much more interoperable than just
shipping dates out in your preferred format only.

Regards,   Martin.

Received on Monday, 22 October 2001 04:55:01 UTC