Adding decimal numbers to time format "HH:MM:SS"

How to add decimal numbers like 2.54 to time format “HH:MM:SS” with 2 being the minutes and 54 being the seconds?

@ROBERT_RUSSELL_MONSA Do you want to Add it to another Date/ Time or do you want to Convert the decimal value into a Time Format?

Hi @ROBERT_RUSSELL_MONSA try this
dateValue.ToString(“MM/dd/yyyy hh:mm:ss.fff tt”));
Date and Time with Milliseconds: 07/16/2008 08:32:45.126 AM
dateValue.ToString(“s.ffff”));
45.1800 seconds

1 Like

hi @ROBERT_RUSSELL_MONSA

In the below link you will get all the Formats

As per your requirement just put it into DateTimeVariable.ToString(FormatYouWant)

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

@ROBERT_RUSSELL_MONSA

Assign this to your variable

TimeSpan.FromMinutes(CDbl(“2.54”))

If you want to fetch Minutes use TimeSpan.FromMinutes(CDbl("2.54")).Minutes
for seconds TimeSpan.FromMinutes(CDbl("2.54")).Seconds

2 Likes