cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Calculate the time between two dates time value

I have a SharePoint List of 5 columns.

1. StartDate(Displaying Date)

2.StartTime(Displaying Time)

3.EndDate(Displaying Date)

4.EndTime(Displaying Time)

5.CourseDuration(Number Type)

PAdate.png

So I want to calculate the time between Start Date and End Date. For Example my startdate is 25/10/2019 and end date is 28/11/2019. So I want to calculate the time period in hour between "StartDate (9:00)Am(Start time) to End date (5:00)pm(end time). and display the calculated output in the Course Duration in PowerApps Form edit form control. Please ShareWIth me if any body have idea. 

Best Regards,

Padmini

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try with below formula in the default property of the data card for CourseDuration column:

Value(DateDiff((DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0)),(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)),Hours))

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Thnq you very much it is working for me. You solved my problem

View solution in original post

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try with below formula in the default property of the data card for CourseDuration column:

Value(DateDiff((DateValue2.SelectedDate + Time(Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0)),(DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value), Value(MinuteValue1.Selected.Value), 0)),Hours))

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Thnq you very much it is working for me. You solved my problem

View solution in original post

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (51,192)