Hi,
Anyone can you please explain how can I give time in GMT format in UiPath,
Now I’m providing current system date and time, If I want to get that in GMT format,
What I can do for it.
-
Assign activity:
- currentDateTime (Variable type: System.DateTime) = Now
-
Assign activity:
- gmtDateTime (Variable type: System.DateTime) = currentDateTime.ToUniversalTime()
-
Assign activity:
- gmtDateTimeString (Variable type: System.String) = gmtDateTime.ToString(“yyyy-MM-dd HH:mm:ss”)
Try this syntax:
DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture)
Hope it helps!!
Regards,
- In the “To” field of the Assign activity, enter the variable name where you want to store the time in GMT format (e.g., “gmtTime”).
- In the “Value” field, enter the following expression:
gmtTime = DateTime.UtcNow.ToString(“yyyy-MM-dd HH:mm:ss”)
Hope it helps!!
Try this
Date=DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture)
I hope it helps!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.