cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Change HourValue to 12 Hour Format + Sharepoint List

Hello, 

 

I'm hoping that someone can help me figure what is turning out to be very difficult for me.

 

I have created a basic Sharepoint List that has three columns. Name, Date and Time Check-in and Date and Time Checkout.

 

I have created a power app using the wizard which allows the user to select the date, hour and minute.  This is exactly what we want.  However, nobody wants to convert 24 hour time in their head.  The dropdown for the hourvalue is asking for 24 hour time value.  

 

How do I "simply" change that dropdown box to ask for 12 hour format and also include AM/PM?

 

I am a new to powerapps and programming in general, but I can't believe that this isn't asked every single day.  The proposed solutions that I could find on this forum and web are way above my head.

 

Please help!

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Change HourValue to 12 Hour Format + Sharepoint List

Hi @ProCell ,

Firstly, the word simple and this process are not very compatible, however, I posted the solution a little while ago on this post.

Happy to elaborate further once you have read and tried this if needed.

 

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.

 

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Change HourValue to 12 Hour Format + Sharepoint List

Hi @ProCell ,

Firstly, the word simple and this process are not very compatible, however, I posted the solution a little while ago on this post.

Happy to elaborate further once you have read and tried this if needed.

 

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.

 

View solution in original post

Highlighted
New Member

Re: Change HourValue to 12 Hour Format + SharePoint List

@WarrenBelz Thank you so much for the quick response.

 

I apologize for mentioning the word simple.  Nothing is simple.

 

I need some clarification on a few items on your post.

 

- I have added the AM/PM drop down

 

- Added default code snip from your post to the AM/PM drop down.  Should I change the "Hour" value to "HourValue1" in your code? Are these the "control names"

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

 

- My Hour Drop Down is actually called HourValue1.  I have added the items in your third snip which is "12".."11" to HourValue1.

 

- I copied and pasted your code snip to the default value of the hourvalue1.  Should I change the "Hour" value in this code to "HourValue1"?

Text(If(Mod(Hour(Parent.Default), 12) = 0, 12, Mod(Hour(Parent.Default), 12)),"00")

 

- What is the Data Card?  You mentioned Update the Data Card with some code and I am new so I need some assistance locating where and what that is.

 

 

I appreciate the assistance and apologize for being so new to this.

 

Thank you!

 

 

Highlighted
New Member

Re: Change HourValue to 12 Hour Format + Sharepoint List

I was able to figure it out.  Your solution works perfectly.

 

The last question I have related to this solution is when outputting the date and time via an automated flow to an email the date and time format shows as 2020-05-04T22:16:06Z.

 

Thanks again!

Highlighted
Super User III
Super User III

Re: Change HourValue to 12 Hour Format + Sharepoint List

Thanks @ProCell ,

This should not change the time format stored in the list - it converts PM back to 24 hour in the Update of the card. What has changed from before?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (9,150)