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 / How to Take Choice Col...
Power Apps
Unanswered

How to Take Choice Column 24hr Times, Convert each to 12hr and Format

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

No clue how to do this.

 

I have a choice column in SPO that we use to assign hours to an engineer.

For example, Engineer A may be assigned the hours 7, 8, 9, 10

Engineer B may be assigned 11,12,13,14

 

Each hour is in 24hr.

 

I need to grab this information based on the engineer using the app.  That part I can handle.

What I dont know how to do is when I get that information in a variable, how to I go through Each piece and convert it.

 

For example, I grab the working hours for Engineer B, which is 11,12,13,14

Now, these numbers are based in CST time.

The first thing I need to do is convert those to the current TimeZone.

For timezone I am currently doing this to get the different time zone.

 

et(var_TimeZone,"UTC"
& If(TimeZoneOffset() > 0, "-", "+")
& RoundDown(Abs(TimeZoneOffset()) / 60, 0)
& ":"
& If(Mod(Abs(TimeZoneOffset()), 60) < 10, "0", "")
& Mod(Abs(TimeZoneOffset()), 60));

 

That variable will show me the current timezone.  For example, Eastern, the variable will return UTC-6:00

So for an Eastern Timezone, I will need to ADD 1 to each one.

11,12,13,14 will now become 12,13,14,15

If the timezone is central, then they stay the same

If Mountain, we subtract 1

If pacific, we subtract 2

 

Using our example, now that we have 12,13,14,15, I need to conver it to 12hr with AM PM, and then format it into a label.

So 12,13,14,15, will become in the final result in a label:

12 PM

1 PM

2 PM

3 PM

 

The am and pm is added, and the numbers are listed top to bottom just like above.

 

Anyway to do this?

Categories:
I have the same question (0)
  • lardo5150 Profile Picture
    Microsoft Employee on at

    So I was able to get the numbers converted via timezone.

    I currently have the output in a label.

    So for example, I have 12,13 in the label.

    I tried this, but it returns false.

    This was set as the text of the label.

    If("12" in Split(ConvertedHours.Text, ","),Substitute(ConvertedHours,"12","12 PM")) &&
    If("13" in Split(ConvertedHours.Text, ","),Substitute(ConvertedHours,"13","1 PM"))

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