Use IJDETimeZone Interface

To modify and display the JDEUTIME data type in the appropriate format, the COM client and GenCOM must use the JDEUTIME APIs. Date and time information is displayed in a time based on the date and time that is in the personal profile or a time zone specified by an application.

These steps, along with sample code, illustrate how to use the IJDETimeZone Interface.

  • Create the IJDETimeZone interface.

    MULTI_QI mqi = { &IID_IJDETimeZone, 0, 0 };
    hr = CoCreateInstanceEx(CLSID_JDETimeZone, 0, CLSCTX_ALL, 0, 1, &mqi);
    if (SUCCEEDED(hr) && SUCCEEDED(mqi.hr)) 
    {
       *ppJdeTimeZone = reinterpret_cast<IJDETimeZone*>(mqi.pItf); 
    }.
    
  • Set the time for a time zone (UTC-5:30) for the data structure DXXXXXX.

    If a time zone is not specified, the time is considered to be at UTC. If an invalid time zone string is passed, then an error occurs.

    DATE dt;
    BSTR bstrUTC = SysAllocString(L"UTC-5:30");
    pJDETimeZone->put_DateTime(bstrUTC,&dt);
    DXXXXXX->put_jdOrderDate(pJDETimeZone);
    
  • Get a time for a given time zone from JD Edwards EnterpriseOne.

    If a time zone string is not passed, the time and date stored in JD Edwards EnterpriseOne, which is at UTC, is returned. If an invalid time string is passed, then an error occurs.

    DXXXXXX->get_jdOrderDate(pJDETimeZone);
    DATE dt;
    BSTR bstrUTC = SysAllocString(L"UTC-5:30");
    pJDETimeZone->get_DateTime(bstrUTC,*dt);