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 / Change 24 Hr format to...
Power Apps
Answered

Change 24 Hr format to 12 Hr Format

(2) ShareShare
ReportReport
Posted on by 145

I am connected to a sharepoint calendar from powerapps.  How do you change the 24 hour format from powerapps to 12 hr format in the input and edit forms?  Thanks.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,833 Most Valuable Professional on at

    Hi @UC3378 ,

    Add another drop down at the right with Items

    ["AM", "PM"]

    and the Default

    If(
      Hour(Parent.Default) < 12,
      "AM",
      "PM"
    ​​​​​​​)

    The Items of the Hour control

    ["12","01","02","03","04","05","06","07","08","09","10","11"]

    and the Default

    With(
      {
      _AMPM:
      Mod(
      Hour(Parent.Default),
      12
      )
      },
    Text(
      If(
      _AMPM = 0,
      12,
      _AMPM
      ),
      "00"
    ​​​​​​​ )
    ​​​​​​​)

    Now the Update of the Data Card

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

    NOTE - you will need to replace the control names above with yours.

     

    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.

  • UC3378 Profile Picture
    145 on at

    @WarrenBelz ,

     

    Thanks for your reply.  I tried working on it today but didnt really get a chance to finish it. I will give it a shot again tomorrow.  But one thing i did notice was that my start time data card does not include an AM/PM, so how will that translate to the sharepoint calendar?  

  • Verified answer
    WarrenBelz Profile Picture
    154,833 Most Valuable Professional on at

    Hi @UC3378 ,

    You have to add it to the card on the right of the others (you will need to unlock the card)  - that is the first item I put in.

    Also note that the code will need to be altered to your control names.

     

    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.

  • UC3378 Profile Picture
    145 on at

    @WarrenBelz ,

     

    Thanks that worked, you are a genius!

     

    I have a related issue hope you can help as well.  When I click on a particular day in the calendar, it pops up an edit form and it loads whatever event that is in that day that I want to modify.  The event along with its date and time is loaded correctly on the edit form.  But if I edit the start date and time only and not touch the end date and time at all, or visa versa, it goes out of funk.  So it will update only the start date and time, but will not update the end date and time, it will leave it blank.  And if I go back into the edit form, the end date and time is reset.  Back in sharepoint, it deletes that event altogether.  Have you seen this?  Thanks.

     

    cal1.PNG

    cal2.PNG

     

     

     

  • WarrenBelz Profile Picture
    154,833 Most Valuable Professional on at

    Hi @UC3378 ,

    Happy to help with this, but I will be offline shortly.

    This should be another subject, can you please accept this one and tag me on the new one. Please add some screen shots so ai can understand the issue a bit better.

     

    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.

  • kbirstein1 Profile Picture
    130 on at

    I'm not sure why you are using the Mod() function here. 

     

    If I just use 12 for the Hour default and

     

    DateValue.SelectedDate + Time(
    If(
    AMPM.Selected.Value = "PM",
    12,
    0
    ) + Value(Hour.Selected.Value),
    Value(Minute.Selected.Value),
    0
    )

     

    for the "Update" on the card it gives me the correct Time value.

  • kmsdove Profile Picture
    60 on at

    I started down this path and stumbled on your solution.  I like it.  I'm running a test today and accepted your solution.  I was close. 

  • HEATFreight Profile Picture
    1,024 on at

    Thankyou @WarrenBelz this worked perfectly for me!

  • Gabeworden1 Profile Picture
    2 on at

    This is not showing the time that was saved but defaulting to 12.  how can i fix this?

     

  • MustafaHussain Profile Picture
    173 on at

    Hi @UC3378  did you fixed your Date Time Functionality? 


    I really want something like that but for Data verse

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 556

#2
WarrenBelz Profile Picture

WarrenBelz 412 Most Valuable Professional

#3
Haque Profile Picture

Haque 296

Last 30 days Overall leaderboard