添加了 type="xs:dateTime" 的时区 [英] Timezone added with type="xs:dateTime"

查看:27
本文介绍了添加了 type="xs:dateTime" 的时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用 28/12/12 08:51:51 填充我的日期字段并生成一个 XML 文件时,我得到输出 2028-12-12T08:51:51+00:00.在我的 XSD 文件中,此字段的类型设置为 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.

问题是我只想要日期和时间,而不是时区.所以输出应该是 2028-12-12T08:51:51

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?

推荐答案

Use the pattern as

Use the pattern as

YYYY-MM-DDThh:mm:ss

这样做:-

<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>

这篇关于添加了 type="xs:dateTime" 的时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆