Hello,
is there way to get the "+01:00" from defined timezone?
For example, the setup is:
(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
But I need to have only +01:00.
Is there any standard method for it?
Thanks.
What would you use it for? Could you describe your business requirement?
Or do you mean the user's timezone? You can get it by DateTimeUtil::getUserPreferredTimeZone().
Hi,
As mentioned by Nikolas, not sure what is your requirement but you can check this document for any of the date related functionality: docs.microsoft.com/.../gg837448(v=ax.60)
Client request this format in one of the generated xml files (Customization).
As far as I understand, your question isn't related to getting the system time zone via code.
Could you share more details. Is it about the format of a date/time field? Or some timezone field?
How is the XML created? Via Data management? Or your custom code?
Please share the XML that the system produces now, as well as description how you would like it to appear. And any custom code that you have related to this process.
There is no standard method for this. You need to build your logic something like, convert time in str and use substring method get last 6 characters.
Give a try and let me know if you need any further help there.
Hi DAX Dev,
As Nikolaos said, please share your XML file.
And if you just want to add one hour to the time, you could use
transDateTime = DateTimeUtil::addHours(transDateTime, 1);
Hope this helps.
Hi DAX_Dev ,
I agree with Deepak. You need to get timezone using dateTimeUtil class and then use your own logic by converting that value in a string format and using string function to get the desire output. Whatever you are using to generate your xml may be its your own class, external library or data entity you have to write your own logic.
You can use .NET string formatting functions with '%K' format specifier. Like this:
System.DateTime datetime = ...; str tzOffset = System.String::Format('{0:%K}', datetime);
It'll display the timezone used by the DateTime value - make sure that the value is in the timezone you want (apply the timezone if it isn't).
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 1,933
André Arnaud de Cal... 793 Super User 2025 Season 2
Sohaib Cheema 537 User Group Leader