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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power App - 12 Hour Fo...
Power Apps
Suggested Answer

Power App - 12 Hour Formatting

(1) ShareShare
ReportReport
Posted on by 18
I have a Leave Request Power App connected to a sharepoint list. I want the Power App to show the time option in 12 hour format instead of 24 hour. 
 
 
I added a drop-down for AM & PM option. Default is showing 
If(Hour(Parent.Default)<12,"AM","PM")
 
Hour Default drop down option is showing:
Text(If(Mod(Hour(Parent.Default),12)=0,12,Mod(Hour(Parent.Default),12)),"[$-en-US]00")
 
HOur Items Option is showing: 
["12","01","02","03","04","05","06","07","08","09","10","11"]
 
I have tried to updated the Date Started to reflect the AM & PM option.The Micorosoft List dates(both start & end) will show both dates as AM or PM.
 
This is the current setting for "Update" on my data card
If(Not IsBlank(DateValue2.SelectedDate), DateTime(Year(DateValue2.SelectedDate), Month(DateValue2.SelectedDate), Day(DateValue2.SelectedDate),
Value(HourValue2.Selected.Value), Value(MinuteValue2.Selected.Value), 0))
Categories:
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Using your drop-down name, try this
    If(
       !IsBlank(DateValue2.SelectedDate), 
       DateTime(
          Year(DateValue2.SelectedDate), 
          Month(DateValue2.SelectedDate), 
          Day(DateValue2.SelectedDate),
          Value(HourValue2.Selected.Value) + 
          If(
             AMPMDropdown.Selected.Value = "PM",
             12
          ), 
          Value(MinuteValue2.Selected.Value), 
          0
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • DHall-1 Profile Picture
    18 on at
    That worked. Thank you so much
     

  • Suggested answer
    CU22111957-0 Profile Picture
    2 on at
    Just wanted to post this. Thanks @WarrenBlez for your post. It worked for me, but I found a bug where it doesn’t handle the special case for 12 AM correctly.
    If(
        !IsBlank(StartDateValue.SelectedDate),
        DateTime(
            Year(StartDateValue.SelectedDate),
            Month(StartDateValue.SelectedDate),
            Day(StartDateValue.SelectedDate),
            If(
                StartHourValue.Selected.Value = 12,
                If(StartAMPM.Selected.Value = "AM", 0, 12),
                Value(StartHourValue.Selected.Value) + If(StartAMPM.Selected.Value = "PM", 12, 0)
            ),
            Value(StartMinuteValue.Selected.Value),
            0
        )
    )
    

    This formula checks if the selected hour is 12 and adjusts accordingly:
    • If it’s 12 AM, it sets the hour to 0.
    • If it’s 12 PM, it keeps the hour as 12.
    • For other hours, it adds 12 if it’s PM.
     
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
  • SpoTechGeek Profile Picture
    63 on at
    My post here could help you out: Configuring Date Picker in AM/PM Format

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard