Documentum DQL: How can I get UTC time zone for Date columns to parse to .NET?

11.2k views Asked by At

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?

2

There are 2 answers

0
lastnitescurry On

For date format see dfc.date_format = setting which you can define in your dfc.properties file.

An excerpt from dfcfull.properties for details:

date format can be specied using the syntax of the Java SimpleDateFormat class

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

0
Zlelik On

For DQL there is a datetostring function and it is possible to use it like this

select datetostring(r_creation_date, 'dd/mm/yyyy') from dm_document

it will return 28/12/2014

or with time like this

select datetostring(r_creation_date, 'dd/mm/yyyy hh:mi:ss') from dm_document

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.