Then using Log Message output the values, firstString shows 2026-01-25T and secondString shows 19:29:40Z
But if I do:
firstString + secondString
or
String.Concat(firstString,secondString)
It gives me the wrong format:
01/25/2026 19:29:40
What the heck is happening?! I’m sure the original expression was working because I used it in an API call (Orchestrator HTTP Request) and it properly returned data. We published to production and ran it, got a HTTP 400 error. I open the project today, and now I’m getting this weird result where it won’t output the format.
Even if I just literally type the values out in the Assigns:
UiPath is implicitly converting the values back to DateTime when you concatenate them, so it applies the system date format (01/25/2026 19:29:40).
To avoid this, format the DateTime in one step or force pure string concatenation, for example:
DateAdd(DateInterval.Hour, -48, Now.ToUniversalTime).ToString(“yyyy-MM-ddTHH:mm:ssZ”)
or use string interpolation like $“{firstString}{secondString}”.
That does the same thing, it does not output the specified format. That’s why I ended up going down this rabbit hole of trying to find a way to break it up to get the desired value.
In that context, within that activity, the formatting IS working correctly. It just seems to be the Log Message/Write Line activities that are re-converting the strings back to datetime. The automation was faulting at the Orchestrator HTTP Request activity, so I thought the expression was the problem, but it wasn’t (it was a permissions issue).
EDIT: I just realized, and tested, that it appears the above expression works because the “/odata/Jobs…” part is a string and it can’t be a date in a string. If I do this:
So it seems like the issue is when you’re concatenating two or more strings that could be interpreted as datetimes, then the problem happens. If any of the strings can’t be interpreted as dateimes, then you don’t see this problem.
@loginerror hoping someone from UiPath sees this post. This needs to be fixed. I tested in the latest 25.x version of UiPath.System.Activities and it still does the same thing.
Let me discuss this internally (probably with the Studio team). From what I remember off the top of my head, it’s the Studio that manipulates the Output panel entry. So you can never win this war as long as the date string looks like something “parsable”.