Documentum DQL:如何获取日期列的 UTC 时区以解析为 .NET?
Documentum(通过 DFC 的 DQL)始终将日期结果列返回为格式如下的字符串:
Wed Oct 19 16:01:59 PDT 2011
...并且 .NET DateTime.Parse
函数对此感到窒息 - 尤其是 PDT
字符串的时区(TZ)部分——据我所知,在 DateTime 解析中没有这些 TZ 缩写的概念。当然,它会理解 +8:00
,但不会理解 PDT
。
TZ 基于内容服务器的 TZ,该 TZ 可能并不总是与 Web 服务的使用者相同的 TZ(我们通过 Web 服务提供 DQL 结果)。
所以...如果我能让 Documentum 始终在这些字符串中给我 UTC 时间,我就可以在客户端上轻松地进行转换,并且始终拥有正确的时区。
这可以做到吗?内容服务器是否有 Documentum 设置以始终返回 GMT 时间?
替代解决方案?
Documentum (DQL via DFC) always returns Date result columns as a string formatted like this:
Wed Oct 19 16:01:59 PDT 2011
...and the .NET DateTime.Parse
function chokes on this — especially the PDT
time zone (TZ henceforth) part of the strings — as far as I can tell, there is no concept of these TZ abbreviations in the DateTime parsing. Sure, it'll understand +8:00
but not PDT
.
The TZ is based on the TZ of the content server, which may not always be the same TZ as the consumer of the web service (we're feeding out the DQL results via web service).
SO... if I can get Documentum to ALWAYS give me the UTC time in those strings, I can do the conversion quite easily on the client and always have their correct time zone.
Can this be done? Is there a Documentum setting for the content server to always return GMT times?
Alternative solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有关日期格式,请参阅您可以在
dfc.properties
文件中定义的dfc.date_format =
设置。摘自 dfcfull.properties 的详细信息:
您拥有什么版本的 Content Server?在 D6.x 中,日期存储在 UTC 中,并由 Documentum 客户端应用程序转换为客户端的本地 TZ。欲了解更多详情,请参阅:
https://community.emc.com/message/545879#545879
For date format see
dfc.date_format =
setting which you can define in yourdfc.properties
file.An excerpt from
dfcfull.properties
for details:What version of Content Server do you have? In D6.x dates are stored in UTC and transformed to local TZ of client by Documentum client apps. For more details see:
https://community.emc.com/message/545879#545879
对于 DQL,有一个 datetostring 函数,可以像这样使用它,
它将返回 28/12/2014
或像这样的时间,
它将返回 28/10/2014 23:58:35
对于 DFC,不建议使用getString 获取日期。推荐使用getTime方法。它将返回 IDfTime 对象,该对象可以转换为标准 Date 对象。
For DQL there is a datetostring function and it is possible to use it like this
it will return 28/12/2014
or with time like this
it will return 28/10/2014 23:58:35
for DFC it is not recommended to use getString for dates. It is recommended to use getTime method. It will return IDfTime object that can be converted to standard Date object.