Home Documentum

Getting 05:30 hours difference when fetching date from a form's date field

edited July 21, 2015 in Documentum

Hi all,

I am trying to fetch a date field value from a form by using below code snippet :

public Document execute(Document origDoc, DocbaseXFormsContext context)

  throws AdaptorException {

  JXPathContext validateContext = JXPathContext.newContext(origDoc);

  DfClientX clientX = new DfClientX();

  IDfSession session = null;

  try {

  session = getSessionFromDocBase();

  logger.info("Executing FSSVHD correction processor");

  System.out.println("Executing Document Processor.....");

  String rootPath = "/Activity/ProcessData/Variables/";

  String invoiceDate = validateContext.getPointer(

  rootPath + "InvoiceActualDate").getValue().toString();

  System.out.println("invoice date = " + invoiceDate);

  }

But getting the date as 5:30 hours less then the date and time mentioned in the forms fields at form submission time.

Kindly suggest if i can get the exact same date time value, as mentioned in the form.

Thanks & Regards,

Avdhesh Gaur

Comments

  • edited July 17, 2015

    Change the server time and time zone then restart and then try.

  • edited July 17, 2015

    Where can this be done?

  • edited July 18, 2015

    Hi Vinod,

    Thanks for the response....!!

    As we have already make the same time zone settings on content and app

    server.

    The time zone we are using is US english TZ.

    Regards,

    Avdhesh Gaur

    ECN <https://community.emc.com/?et=watches.email.thread&gt; Getting

    05:30 hours difference when fetching date from a form's date field

    reply from Vinod

    <https://community.emc.com/people/Vinojass?et=watches.email.thread&gt; in

    Documentum - View the full discussion

    <https://community.emc.com/message/896466?et=watches.email.thread#896466&gt;

  • edited July 20, 2015

    Check the time zone of server machine and your client machine. If its different then change the time zone then restart the server machine, if you have changed time zone , then I think you forgot to restart so try after restart....

  • edited July 20, 2015

    Hi Vinod,

    That is not working. As i am checking in my UAT environment, facing the

    same issue. Although using the same machine as client and server.

    Regards,

    Avdhesh Gaur

  • edited July 20, 2015

    I don't know how dates are stored in form fields, but my guess is:

    - Forms uses DFC to store date

    - DFC converts local time to UTC

    - Forms stores UTC date

    - You're reading the stored UTC date from the XML, so you need to convert to your local time zone.

  • edited July 21, 2015

    Hi Alvaro,

    The date is getting stored in form field as local time, but when we are fetching the date by using DFC code, it converts the time to UTC and reflecting 05:30 hours difference..

    So now i think, we need to convert the UTC date to our local date by using some DFC code.

    Kindly suggest, if this seems the good process to handle the same.

    Regards,

    Avdhesh Gaur

Sign In or Register to comment.