English 中文(简体)
XMLMapper中的时区指定是否有效? XMLMapper中的时区指定是否有效?
原标题:Do time zone specification in XMLMapper works?

我从 XML 文件中收到的 DateTime 格式是:2009-12-14 05:07:38Z。

所以,我以为那是一个错误,但在进行了一些谷歌搜索后,我发现了这个。

将此翻译成中文:http://www.w3schools.com/Schema/schema_dtypes_date.asp http://www.w3schools.com/Schema/schema_dtypes_date.asp

Time Zones To specify a time zone, you can either enter a time in UTC time by adding a "Z" behind the time - like this:

09:30:10Z 的翻译为:09:30:10Z

但是当我在XMLMapper中的节点中指定DateTime时:我的日期时间被截断,我只得到了日期。

我需要更多咖啡吗?

怎样管理这个?(Zěn yàng guǎnlǐ zhègè?)

谢谢 (xiè xie)

最佳回答

雨杰

Z(Zulu)时区表示法来自ISO 8601,可以用于时间值或日期时间值。您示例中的字符串包括一个表示日期的字符串 2009-12-14,一个空格分隔符和一个带有时区指示符的时间字符串 05:07:38Z。如果您想要一个组合日期和时间表示,则中间的空格应替换为 T,即 2009-12-14T05:07:38Z。

我对XMLMapper不熟悉,但它似乎根据ISO 8601正确解释了字符串,仅处理了空格之前的部分。您可以单独处理字符串的时间部分并将它们组合起来,或在处理之前将 替换为 T,或者甚至对其进行子类化以接受这种(极其常见的) 篡改表示...

麦克斯

问题回答

暂无回答




相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签