Hello. I want to generate random minutes and seconds in the format of HH:MM:SS. I want to generate random minutes between 0 min to 1 min max. I can generate seconds normally but minutes are not working.
waitTime’s value is '00:" + randomMin.ToString + “:” + randomSec.ToString’
Delay’s duration value is 'TimeSpan.Parse(waitTime)'
Output is always being 'Random time is 00:0:35’
What am I doing wrong?
@private_matter Either you can use the activity as in the below post or you can use the below expression in an assign acitivty.
Modify the range as per your need.
Try as below
- use Assign activity and declare a variable of Int32, let say randomMin
- Now write as New Random().Next(0,2)
- Write in writeline activity as below
This will add 0 to the result
Hope this may help you
I hope it helps to fix the problem.
randomTime.xaml (6.2 KB)
Still not working. That’s what I get as output.
Waw!!! You nailed it!
Works flawlessly. Exactly what I was looking for. Thank you so much @muhammedyuzuak
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.