Hi All!
I have startTime and an endTime as DateTime variable that looks like 2019-12-02 08:00:00 and 2019-12-02 11:45:00. I want to calculate the hours and minutes so it results in a String and look like: 3.75.
Thank you!
Hi All!
I have startTime and an endTime as DateTime variable that looks like 2019-12-02 08:00:00 and 2019-12-02 11:45:00. I want to calculate the hours and minutes so it results in a String and look like: 3.75.
Thank you!
Hi @JackALope
use below code
(DateTime.ParseExact("12/30/1899 18:00:00", "MM/dd/yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture)-DateTime.ParseExact("12/30/1899 08:30:00", "MM/dd/yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture)).TotalHours.ToString()
Regards,
Kommi Jeevan.
span.xaml (5.8 KB)
Thanks!
Welcome to UiPath Community!.
Try like the following,
Convert.ToString( (DateTime.ParseExact("2019-12-02 08:00:0", "yyyy-MM-dd hh:mm:ss",System.Globalization.CultureInfo.InvariantCulture)-DateTime.ParseExact("2019-12-02 11:45:00", "yyyy-MM-dd hh:mm:ss",System.Globalization.CultureInfo.InvariantCulture)).Hours)
I have create workflow based on requirement please check I hope you will get the solution.
Time Diff.xaml (4.7 KB)
Thank you a lot! The thing is that I would like the minutes to be devided into hours, so if you have a time difference of 3 hours and 45 minutes, this should result in 3.75 instead of 3.45.
Try this:
Thank you so much everyone!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.