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.
Anonymous
Not applicable

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

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,957)