Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 3xTuo/Lr5ros7gdgp6iLg+
Power Apps - Building Power Apps
Answered

Time Picker AM/PM Hour and Minute

Like (0) ShareShare
ReportReport
Posted on 16 Jun 2020 05:37:51 by 1,057

Hello, Everyone

 

I am using SharePoint Data-source and I want to have a Date Picker with Time Hour and Minute along with AM and PM Selector,

so what I did is this:

TimePicker.png

I changed the minute value picker into AM/PM selector, but I need Hour, Minute and AM/PM Auto Selected as per current time

Update Formula: 

DateValue4_2.SelectedDate + Time(If(MinuteValue4_2.Selected.Value = "PM", 12, 0) + Mod(Value(HourValue4_2.Selected.Value), 12), 0, 0)


I need the Minute picker as well and the Hour Minute and AM/PM should auto pick by default as respect to the current time.

Need help for adding minute value.

 

 

Any Help


  • WarrenBelz Profile Picture
    146,518 Most Valuable Professional on 20 Mar 2024 at 21:03:10
    Re: Time Picker AM/PM Hour and Minute

    @PowerAppsMerf2 ,

    Can you please create a new thread for this issue

  • PowerAppsMerf2 Profile Picture
    11 on 20 Mar 2024 at 15:40:59
    Re: Time Picker AM/PM Hour and Minute

    Hello, I used your code, and still need some help.  

     

    I am trying to setup a Sharepoint calendar where users can request equipment on a specific time (hour and quarter hour resolution), and date. I initially setup a Date and Time column in List Settings, but only the date was selectable when I created a form in PowerApps.

     

    I then added drop down time picker boxes in my data card, but no matter what is selected on the form, it always populates the calendar with the date and time the form was submitted.

     

    I have been trying to get this to work for a few days. I am happy to share any configurations and settings.

     

    I would appreciate any help!

    Thank you

    large_preview.png

    The form selection shown on March 19 was for several days the following week, but it shows the date and time the form was submitted.

    PowerAppsMerf2_0-1710949184945.png

     

  • WarrenBelz Profile Picture
    146,518 Most Valuable Professional on 19 Feb 2023 at 20:25:13
    Re: Time Picker AM/PM Hour and Minute

    @MustH ,

    Here is a post of mine explaining the process.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • MustafaHussain Profile Picture
    173 on 19 Feb 2023 at 16:29:15
    Re: Time Picker AM/PM Hour and Minute

    Hi @v-siky-msft 

    I want to have the Time Picker as Like in 12 hour format not in 24 hour because it will be really hard for the user to select the time for evening with the minutes too

    like for 5:00 PM evening in 24 hour format it will be 17:00. 

    I would like my Hour values from 12,01,02,03,04,05,06,07,08,09,10,11

    and minutes something like that so it will recognize that its PM not AM.

  • 9dj89 Profile Picture
    on 05 Mar 2021 at 18:59:24
    Re: Time Picker AM/PM Hour and Minute

    Please try using 

    Right( Text( Now()), 2)

     

    This will give you the AM or PM portion of the current time. You can use this in the default section of the drop-down.

     

    Thanks, 

  • MH3 Profile Picture
    1,057 on 13 Jul 2020 at 16:43:58
    Re: Time Picker AM/PM Hour and Minute

    Hi @v-siky-msft ,

    after checking the app, I am having a little bug in the Time Selector,
    I have used your code under this if statement, and it shows 12 only every time, while the Minute value is working fine.




    any help? 
    Hour Value > Update Code

     

    If(ReqFrom.Mode=FormMode.Edit,Text(If(Mod(Hour(Parent.Default), 12) = 0, 12, Mod(Hour(Parent.Default), 12)),"[$-en-US]00"))

     

    Minute Value: > Update Code:

    If(ReqFrom.Mode=FormMode.Edit,Text(Minute(Parent.Default),"[$-en-US]00"),Text(Minute(VarCurrent),"[$-en-US]00"))

     


     

  • MH3 Profile Picture
    1,057 on 18 Jun 2020 at 04:33:29
    Re: Time Picker AM/PM Hour and Minute

    Hi @v-siky-msft ,

     

    I have tried your formula, it's working perfect.

    but when I edit the record the time picker should display the default selected time when I created the record and should display Current time when creating new record.

     

    how to alter it? can you guide?  for edit and new form?

  • Verified answer
    WarrenBelz Profile Picture
    146,518 Most Valuable Professional on 17 Jun 2020 at 08:30:37
    Re: Time Picker AM/PM Hour and Minute

    @MH3 ,

    What is the error on? Can you please pull this apart until it runs and identify which piece of code is causing the issue.
    Also you might try this

    Reset(RequestDate_DataCard1_2);
    If(
     RemForm.Mode=FormMode.Edit,
     Patch(
     'Travel Request',
     {ID:ReqGal.Selected.ID},
     ReqFrom.Updates,
     InfoForm.Updates,
     TripForm.Updates,
     PrefForm.Updates,
     RemForm.Updates
     ), 
     Patch(
     'Travel Request',
     Defaults('Travel Request'),
     ReqFrom.Updates,
     InfoForm.Updates,
     TripForm.Updates,
     PrefForm.Updates,
     RemForm.Updates
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • MH3 Profile Picture
    1,057 on 17 Jun 2020 at 05:26:22
    Re: Time Picker AM/PM Hour and Minute

    Sir @WarrenBelz ,

     

    I saw your post, I just did what you have said in your post and updated my Update Property, according to my requirement, but still the time problem is there..

  • WarrenBelz Profile Picture
    146,518 Most Valuable Professional on 17 Jun 2020 at 04:07:16
    Re: Time Picker AM/PM Hour and Minute

    @MH3 ,

    You are really getting adventurous to Patch a modified date control. If you go back to the link in my original post, you will see the Update property of the modified card - you should be able to work from that

    DateControlName.SelectedDate + 
    Time(
     If(
     AmPmControlName.Selected.Value = "PM", 
     12, 
     0
     ) + 
     Mod(
     Value(
     HourControlName.Selected.Value
     ), 
     12
     ), 
     Value(
     MinuteControlName.Selected.Value
     ),
     0
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,751 Most Valuable Professional

Leaderboard