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 DateFormat in D...
Power Apps
Unanswered

Change DateFormat in Dropdown Control

(1) ShareShare
ReportReport
Posted on by 2

Hi, 

 

I need some help changing the Datetime format in a Dropdown control. This is purely a cosmetic change as the code seems to work so far. 

 

My current setup:

In the App OnStart property I have the following Sequence which generates a 30 minute incremented table based on the company opening and closing times:

Set(CompanyStartTime, TimeValue("07:30"));
Set(CompanyEndTime, TimeValue("20:00"));

Set(CompanyHours, 
 ForAll(
 Sequence(
 (CompanyEndTime+1800000-CompanyStartTime)/1800000
 ),CompanyStartTime-1800000 + Value*1800000
 )
);

 

This in return saves the following table in the "CompanyHours" variable:

_ssComa_0-1685002424720.png

 

Using "CompanyHours" in the .Item property of a DropDown control gives me the correct values, but sadly they are in AM/PM format which I would like to change to military time (HH:mm):

_ssComa_2-1685002568578.png

 

I haven't found a simple way to do this, the table requires to be in DateTime for other functions within my app to work properly. AddColumns wouldn't be an option since there's function's dependent directly on the dropdown selected item. 

 

If anyone knows a way to change the DateTimeformat or can recommend a better practice than my method I would gladly hear your input! Your help is greatly appreciated! 

 

-Coma

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Put this on the onStart property off the app (if the companyHours is already created)

    ForAll(CompanyHours, Collect(test, Text(Value, "hh:mm")));

     

    And put the collection 'test' inside the DropDown 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard