Hi all,
I hope someone can help me with the following issue I am dealing with.
When executing the functions DT2DATE and DT2TIME in a business logic that is published as a web service in BC SaaS I am unable to get a correct result. For on premise installations we can change the parameter "Services Default time Zone" to "Server Time Zone" on the service tier, but in a SaaS environment everything is handled as UTC which is not always correct.
Lets say we have a DateTime, e.g. 10/05/2020 23:00 (UTC).
When applying the DT2DATE function from a web client context in time zone UTC+2, the result would be 11/05.
When doing the same thing in a web service context the result will always be 10/05 since the logic is always applied on the UTC value.
I am trying to update production routing lines via the web service so this results in a wrong calculation when taking e.g. shop calendars into account. I tried a lot of workarounds but none gave me a correct result since the production logic is using DT2TIME and DT2DATE in multiple places.
I also tried SessionSettings.TimeZone([NewTimeZone: String]) but that didn't seem to change any behavior.
Any other workaround I am missing?
Regarding the "Service Default Time Zone", I got the following confirmation from Microsoft:
UTC time is utilized as a standard for all tenants worldwide. Please keep in mind that this is set this way by designed and all Microsoft platforms are managed this way, development areas and such are located in Danmark as a difference form the On Premises which will be manage by the servers of the organization and its time zone. In addition to this, it seems that the functions described related to customization and extension developments am afraid are out of our Break & Fix support, however to enlight you a bit further about what can be done you can utilize a time zone converter to calculate in your current time zone.