SaaS CMS has officially launched! Learn more now.

Mediachase.Commerce.Manager.Apps.Reporting.ReportingBaseClass.GetDaylightSavingsOffsets() method is no longer supported in Optimizely 12 .net core

Vote:
 

Hi All, 

I need to use the GetDaylightSavingsOffsets() method, we're currently doing a migration from Opti10 to Opti12 .net core but that method does not longer exist in the Mediachase.Commerce. Does anyone know if the method exist in other namespace? Or doesn't the method exist anymore? If the method is no longer available does anyone else was able to replace the method with another one or does exist a workaround to replace its funcionality?

Any help is really appreciate it.

Thanks in advance,

#299313
Mar 31, 2023 16:33
Vote:
 

Commerce Manager was removed in Commerce 14 (which is compatible to CMS 12) so any features were removed. If you really need the functionality, here's how the code was written

protected void GetDaylightSavingsOffsets(out int offset_dt, out int offset_st)
        {
            offset_dt = Convert.ToInt32(new DateTimeOffset(DateTime.Now).Offset.TotalHours);
            offset_st = DateTime.Now.IsDaylightSavingTime() ? offset_dt - 1 : offset_dt;
        }
#299359
Apr 01, 2023 20:06
Vote:
 

Thanks Quan!

That is what I needed.

Regards,

#299989
Apr 12, 2023 14:31
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.