Hi. I’m using invoke method activity in UiPath to verify a string. The command is :
BeginTimeIsProper = DateTime.TryParseExact(BeginTime,“yyyy-MM-ddThh:mm:ss.fffZ”,System.Globalization.CultureInfo.CurrentCulture,System.Globalization.DateTimeStyles.None,BeginTimeDate)
Following are the screenshots of activity, it’s properties:
It’s failing to parse 24hr format time and it’s working for 12 hour format.
I tried with System.Globalization.CultureInfo.InvariantCulture also, but still it’s failing to parse 24hr format.
I need this format “yyyy-MM-ddThh:mm:ss.fffZ” DateTime to be send to UiPath orchestrator API requests. As an alternative, I tried to use DateTime.TryParse method from
Microsoft.OData.Edm namespace, but this namepsace is not available in my Studio. It’s not even showing in imports panel, when I’m trying to search there.
Can someone please help me to parse this date and time even if user is giving hours in 24hr format?