web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add additional time to...
Power Apps
Answered

Add additional time to a date and time already displayed

(1) ShareShare
ReportReport
Posted on by

Hi Experts,

 

I have an app with 7x TextInput fields. One of them displays the date and time now (as below)

TextInputTime
Text(Now(),"[$-en-GB]dd/mm/yyyy hh:mm:ss","en-GB")

 

The other 6x fields will have the below shown in them.

TextInput1
3 days

 

TextInput2
1 day

 

TextInput3

8 hours

 

TextInput4
5 hours

 

TextInput5
2 hours

 

TextInput6
30 minutes

 

What i'm wanting to do is add the timing displayed in TextInput1 - TextInput6 based on the selection of a dropdown made previously to the TextInputTime field by doing something like:

If('Dropdown-Impact'.Selected.Value = "Nobody Affected", TextInputTime.Text,
'Dropdown-Impact'.Selected.Value = "Only Affecting One Person", TextInputTime.Text,
'Dropdown-Impact'.Selected.Value = "Affecting Group of People", TextInputTime.Text,
'Dropdown-Impact'.Selected.Value = "Affecting a Department", TextInputTime.Text,
'Dropdown-Impact'.Selected.Value = "Affecting Entire Business", TextInputTime.Text
)

 

Please help, thanks in advance

Dave

Categories:
I have the same question (0)
  • PPDEV Profile Picture
    142 on at

    Hi @Dave-ITMan, I think the easiest way to do achieve your requirement is by using DateAdd native function of Power Apps.

     

    You can try the following code to test and try to experiment that will align to your requirements:
     DateAdd( Now(), 3, TimeUnits.Days )

    Hope this helps!

  • Dave-ITMan Profile Picture
    on at

    Hi @ppDev_30 ,

     

    Thanks for the reply. That is saying that .Days isn't recognized which I think is because the original date in TextInputTime has been converted to text in order to display correctly in UK time as it keeps pulling through American time. 

     

    Regards

    Dave

  • Verified answer
    PPDEV Profile Picture
    142 on at

    Hi @Dave-ITMan, please try this switch condition code

     

     

     

    Switch(
     ddType.Selected.Value,
     "Nobody Affected", DateAdd(Now(), Value(Left(Label1.Text, 1)), Mid(Label1.Text, Find(" ", Label1.Text) + 1)),
     "Only Affecting One Person", DateAdd(Now(), Value(Left(Label1_1.Text, 1)), Mid(Label1_1.Text, Find(" ", Label1_1.Text) + 1)),
     "Affecting Group of People", DateAdd(Now(), Value(Left(Label1_2.Text, 1)), Mid(Label1_2.Text, Find(" ", Label1_2.Text) + 1)),
     "Affecting a Department", DateAdd(Now(), Value(Left(Label1_3.Text, 1)), Mid(Label1_3.Text, Find(" ", Label1_3.Text) + 1)),
     "Affecting Entire Business", DateAdd(Now(), Value(Left(Label1_4.Text, 2)), Mid(Label1_4.Text, Find(" ", Label1_4.Text) + 1))
    )

     

     

     

     

    This code finds the value you wanted to add in the date

     

     

     

    Value(Left(Label1.Text, 1))

     

     

     

     

    While this code will find the time units you wanted to use (Days, Hours, Minutes)

     

     

     

    Mid(Label1.Text, Find(" ", Label1.Text) + 1)

     

     

     

     

    I have tested it on my end and it works, I've included screen for your reference.

    12.07.2024_07.44.15_REC.gif

     

     

     

    Hope this helps!

  • Dave-ITMan Profile Picture
    on at

    Hi @ppDev_30 ,

     

    This has worked perfectly thank you. The only issue that I have is that the date is showing in American format, do you know how I can adjust the code to change it to UK format please DD/MM/YYYY? 

     

    Currently showing as

    DaveITMan_0-1720774326641.png

     

     

    Thanks again

    Dave

  • Dave-ITMan Profile Picture
    on at

    Hi @ppDev_30 ,

     

    I've managed to sort my issues by amending the code as per the below:

    "Nobody Affected", DateAdd (Text(Now(), "[$-en-GB]dd/mm/yyyy hh:mm:ss","en-GB"), Value(Left(NobodyAffectedRespSLA.Text, 1)), Mid(NobodyAffectedRespSLA.Text, Find(" ", NobodyAffectedRespSLA.Text) + 1)),

     

    Thanks again for your help

     

    Regards

    Dave

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 339 Most Valuable Professional

#2
11manish Profile Picture

11manish 180

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard