I'm facing an issue displaying the createddatetime record.
The user requires see the column in the company time zone, as we are working in D365FO the createddatetime is stored in UTC-0, we are working with UTC-6, the first solution I tried to apply was writing the next code to display the record with the company time zone.
info(strFmt("%1",DateTimeUtil::newDateTime(
DateTimeUtil::date(table.CreatedDateTime),
DateTimeUtil::time(table.CreatedDateTime),
DateTimeUtil::getCompanyTimeZone())));
I expected to get the CreatedDateTime with 6 hours subsctracted, but the info displays me the record with 6 hours added.
Example
The Record is stored with the next value: 2019-05-13 00:02:25
I expect the next value with 6 hours substracted: 2019-05-12 18:02:25
but the job retrives me the value with 6 hours added: 2019-05-13 06:02:25
I changed the company time zone to UTC+6 and it "worked" but is wrong because the time zone isn't the correct for the company.
If anyone has any idea what could happen, I would appreciate the suggestions.
thanks in regards
Jose.