There was a case where i need to get this kind of output hh:mm:ssZ where Z stands for UTC Time Zone (20:15:00+0200) to the external system for integration.
For Instance, the current time zone in the system is UTC +02:00 and we need to get this value (+0200) from Navision. There are no predefined functions to get this value so for that i have created a new function GetUTCOffset which can be used to get the UTC offset.
If the Time zone is UTC +02:00 then the Output will be +0200
If the Time zone is UTC +02:00 and we have DST (Daylight Saving Time) then the Output will be +0300
I have formatted the final output of the Time to remove the “:” using the below code.
FORMAT(lLocalTime,0,lSign + ”)
You can format the output per your requirement.
Please do let me know if in case there are some issues & suggestion about the code & approach. Thanks