Skip to main content
Community site session details

Community site session details

Session Id : maceggMXXaUtWp7heskHZL
Power Apps - Building Power Apps
Answered

Adding hours to date.

Like (1) ShareShare
ReportReport
Posted on 24 Oct 2018 21:00:17 by 7

Hello all,

 

What I am trying to accomplish is a text box that shows a new date stemming from hours added onto the date selected.  In excel I was using:

=IF(D81="","",IF(AND(ISNUMBER(D81),F81=""),$C$77+(D81/24),IF(ISNUMBER(F81),$C$77+(F81/24))))

 

Thanks in advance for the assistance.

 

 

Date+Hours.jpg

Categories:
  • Community Power Platform Member Profile Picture
    on 03 Dec 2019 at 13:11:18
    Re: Adding hours to date.

    @v-xida-msft

     

    This is such a terrific way to help, thank you! However, I do not know why but looking at many of the syntax in these forum posts seems to not working in my new version of PowerApps fx.: If(IsBlank(xxxxxx.Update).....

     

    I do not know why but the function does not work - Can you give me a hint as to why although I am using the exact same method as you have in the Gif/your screenshot? Greatly appreciated, thank you!

     

     

  • Sevendust Profile Picture
    7 on 30 Oct 2018 at 14:28:54
    Re: Adding hours to date.

    You are AWESOME!!!! Much thanks!!

  • Verified answer
    v-xida-msft Profile Picture
    on 26 Oct 2018 at 08:31:59
    Re: Adding hours to date.

    Hi @Sevendust,

    Could you please share a bit more about your scenario?

    Do you want the End Date/Time to be equal to selected date (e.g. '10/25/2018 18:30 ') plus actual hours?

    If you want the End Date/Time field to be equal to selected date (e.g. '10/25/2018 18:30 ') plus actual hours within your Edit form, I think the DateAdd function could achieve your needs.

    I have made a test on my side, please take a try with the following workaround:14.JPG

    Set the Default property of the End Date Data card to following formula:

    If(
    IsBlank(Actual_x0020_Hours_DataCard2.Update),
    Start_x0020_Date_DataCard2.Update,
    DateAdd(Start_x0020_Date_DataCard2.Update,Actual_x0020_Hours_DataCard2.Update,Hours)
    )

    Note: The Start_x0020_Date_DataCard2 represents the Start Date Data card control, the Actual_x0020_Hours_DataCard2 represents the Actual Hours Data card control.

    The GIF screenshot as below:Test1.gif

     

     

    More details about the DateAdd function in PowerApps, please check the following article:

    DateAdd function

     

    Best regards,

    Kris

  • HadynM Profile Picture
    279 on 24 Oct 2018 at 21:50:21
    Re: Adding hours to date.

    Hi @Sevendust

    The DateAdd function sounds like what you're after:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

    Use it like:

    DateAdd(StartDate,Value(ActualHours),Hours)

    Hope that helps

    Hadyn

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete