How to convert milliseconds to TimeSpan in UiPath

Converting a integer value to a timespan is not that difficult to do.

Where this be useful?

  • When we are automating a business process we tend to see some processes where you need to wait for some time to perform the next operation.
  • Where you are getting some output from the current activity which is used in the delay activity but it only accepts timespan value. So, you need to convert that to a timespan if the activity doesn’t have any delay before or after the property.

Let’s see how we can achieve that here :


In the above image you can see the command which is used to achieve this, let me break that down:

Here we are converting milliseconds(1000) to Timespan.

Converting a integer value to Timespan is not limited to milliseconds.

There are few more methods you can use as listed below:

  • TimeSpan.FromMilliseconds(1000)
  • TimeSpan.FromDays(1)
  • TimeSpan.FromHours(2)
  • TimeSpan.FromMinutes(30)
  • TimeSpan.FromSeconds(20)
  • TimeSpan.FromTicks(10000)


Ticks- This is the smallest unit of time.

Which is equal to one tenth of a second.

10,000 ticks equals a millisecond.

This is about converting an integer to Timespan in UiPath.

Happy Learning!

Like this post then let your friends know about this-:

Leave a Reply

Your email address will not be published. Required fields are marked *