How To Convert Milliseconds To TimeSpan In UiPath

There might be situations where we might be asked to pass time as TimeSpan rather than in Milliseconds.

Let us see how to do that…

Timespan.FromMilliseconds(int milliseconds)


Implementation using UiPath :

Let us convert 3000 Milliseconds to TimeSpan i.e. 00:00:03

Step 1:
Drag a “Delay” activity into the design panel

UiPath Milliseconds to timespan 1

Step 2:
Type the above code with 3000 in it into the “Duration” property of Delay activity.
i.e. Timespan.FromMilliseconds(300)

UiPath Milliseconds to timespan 2


Click here to download the Source Code…

Hope it has helped you… 


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: