Timezone added with type=“xs:dateTime”

元气小坏坏 提交于 2020-01-02 08:04:31

问题


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?


回答1:


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>


来源:https://stackoverflow.com/questions/14067105/timezone-added-with-type-xsdatetime

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!