user1809753
user1809753

Reputation: 165

Timezone added with type="xs:dateTime"

When I fill my date field with 28/12/12 08:51:51 and generate an XML file, I get the output 2028-12-12T08:51:51+00:00. In my XSD file, the type of this field is set as xs:dateTime.

The problem is that I only want the Date and Time, and not the time zone. So the output should be 2028-12-12T08:51:51

Does anybody know where this format is set?

Upvotes: 4

Views: 7960

Answers (1)

Siva Charan
Siva Charan

Reputation: 18064

Use the pattern as

YYYY-MM-DDThh:mm:ss

Do this way:-

<xsd:simpleType>
  <xsd:restriction base="xsd:dateTime">
    <xsd:pattern value="\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d" />
  </xsd:restriction>
</xsd:simpleType>

Upvotes: 1

Related Questions