W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Re: MS SQL Server DateTime Type

From: Martin Duerst <duerst@w3.org>
Date: Mon, 22 Oct 2001 17:22:41 +0900
Message-Id: <4.2.0.58.J.20011022171924.0353a8b0@localhost>
To: "Sean Gerety" <SGerety@extremelogic.com>, <xmlschema-dev@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:24 GMT