Closed
Solved
Changing timezone in datetime utility
Hi,
I'm completely new to Pega robotic process automation so I would like to ask if there is a way on how to change or set the timezone using datetime utility perhaps?
@RodelD25 Here is an example. You need to add some static methods from the Global Assembly Cache. To do that;
@RodelD25 Here is an example. You need to add some static methods from the Global Assembly Cache. To do that;
In my example, I am using a DateTimeUtils to get the current time using the Now method. I then call the FindSystemTimeZoneById method which returns a TimeZone object for the specified Id. You'll have to search for these IDs, but I did include the one you asked for. Then I converted it to UTC so that I could then convert it from UTC. This is really just for the automation. In code, you would just do this directly, however I would need to create a TimeZone object for the current time which would be more automation steps.