I have created an app in UiPath that includes a user form to capture user input. When the user enters their data and clicks the Submit button, the data is stored in a UiPath Data Fabric entity.
In the entity, there is a column meant to store the submission date and time. When the user clicks Submit, the date is captured correctly, but the time is stored in IST, whereas I need it to be stored in UTC.
Use ConvertTimeZone() in your UiPath App before saving the date.
In the Submit → Save Data rule, set the date field value as:
ConvertTimeZone(App.DateTimeInput, “India Standard Time”, “UTC”)
This will automatically convert the IST time to UTC before storing it in the Data Fabric entity.
Modify your submit logic to use UTC, e.g. instead of capturing Now,
use DateTime.UtcNow. Save UTC value into your Data Fabric entity’s Date-Time field.
But when you are displaying to users, convert back to their timezone so users see local times
You can do like this :
SubmissionDateTime = DateTime.UtcNow (When you are runnign from bot )
SubmissionDateTime = UserDateTime.ToUniversalTime() – (when you already have datetime form user)
You can convert submit time to UTC, even though the column is String.
Just transform the datetime to UTC and then to string format before inserting into the entity.
We can modify our logic like this
DateTime.Parse(SubmitDateTime).ToUniversalTime().ToString(“yyyy-MM-ddTHH:mm:ssZ”)
To store the submission time in UTC format in your string column replace your current time variable with this expression DateTime.Now.ToUniversalTime().ToString(“yyyy MM ddTHH:mm:ssZ”).
This takes the local time converts it accurately to UTC and then formats it into a standard string that explicitly shows it is UTC time.