Adrian, The solution I implemented is system wide, not just prod. Here is the code I use (I have placed inside the global class). static date localDate() { System.DateTime utcDate; UTCDateTime axUtcDate; UTCDateTime localDate; CodeAccessPermission permission; ; permission = new InteropPermission(InteropKind::CLRInterop); permission.assert(); utcDate = System.DateTime::get_UtcNow(); axUtcDate = DateTimeUtil::anyToDateTime(CLRInterop::getAnyTypeForObject(utcDate)); localDate = DateTimeUtil::applyTimeZoneOffset(axUtcDate, DateTimeUtil::getCompanyTimeZone()); CodeAccessPermission::revertAssert(); return dateTimeUtil::date(localDate); } You will notice that the UTCDateTime is converted back into a date in the return call. Everywhere I want to use local dates you need to convert the code from using SystemDateGet() to LocalDate(). Barry.
↧