Hi All,
I have to find time difference between 2 times in minutes.
For Example
Time 1 - 12:00:00 AM
Time 2 - 2:30:00 AM
So time difference for above Example in minute would be.
150 minutes (Time 2 - Time 1)
Please help.
Hi All,
I have to find time difference between 2 times in minutes.
For Example
Time 1 - 12:00:00 AM
Time 2 - 2:30:00 AM
So time difference for above Example in minute would be.
150 minutes (Time 2 - Time 1)
Please help.
Hi @ravig1206,
The approach can be
.Subtract
methodTimeDifference = DateTime.Parse(Time2String).Subtract(DateTime.Parse(Time1String))
TimeDifference
will be of type argument TimeSpan
.TimeSpan
outputs allow you to aggregate to different measures like TotalHours
, TotalMinutes
, TotalSeconds
etc.,.TotalMinutes
method.Seconds
you can useMath.Round(TimeDifference.TotalMinutes,2)
The output will be of System.Double
argument type.
Here is a starter worfklow: TimeDifferenceinMinutes.xaml (7.2 KB)
@ravig1206 - You can try this too…
DateDiff(dateinterval.Minute,Convert.todatetime(Time1),Convert.todatetime(Time2)))
Output:
Thanks Bro.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.