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

AvdheshKumar
edited July 21, 2015 in Documentum #1

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

  • Vinojass
    edited July 17, 2015 #2

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

  • MCastner
    edited July 17, 2015 #3

    Where can this be done?

  • AvdheshKumar
    edited July 18, 2015 #4

    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;

  • Vinojass
    edited July 20, 2015 #5

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

  • AvdheshKumar
    edited July 20, 2015 #6

    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

  • Alvaro_de_Andres
    edited July 20, 2015 #7

    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.

  • AvdheshKumar
    edited July 21, 2015 #8

    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