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 News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,472)