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 / Date, hour, minute pic...
Power Apps
Answered

Date, hour, minute picker current date, hour, and minute

(0) ShareShare
ReportReport
Posted on by 17

 

The first part of this Text(Hour...) corresponds to a dropdown box to pick the current hour
The 2nd part of all the #'s is to pick the minutes

 

Text(Hour(Parent.Default),"[$-en-US]00")

["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]


The last part is selecting my date (which will just choose off of the last linked event I choose) 

BrowseGallery1.Selected.EventDate


What I am trying to do, is make the date picker to always show the current date, and have the hour and minute box show the current time, but still allow choosing any number.

image.png

 

 

Capture.PNG
Categories:
I have the same question (0)
  • bdodu Profile Picture
    399 on at

    And how is this different from the standard implementation of a DateValue DataCard ?

  • xerxes2985 Profile Picture
    17 on at
    The default is blank. I want it to show the current hour, and I want the date to show the current date, and then let you choose other dates.
  • Verified answer
    CarlosFigueira Profile Picture
    Microsoft Employee on at

    You can change the Default property of the card (the card that holds the value, not the individual controls) so that if the value is null (which is the case for new items) then it will use the current time instead.

    Coalesce(ThisItem.<dateTimeFieldName>, Now())

    Notice that if this field can have null values already stored, then you may overwrite them if you use the expression above. Another alternative is to check the form mode, and if it's in the "NewForm" mode (creating a new item), then use the current date/time like shown below.

    If(
    EditForm1.Mode = FormMode.New,
    Now(),
    ThisItem.<dateTimeFieldName>)
  • xerxes2985 Profile Picture
    17 on at

    Sorry for such a delayed response. The first method you provided works fine for the calendar date as a starting and endpoint. Thanks!

    Coalesce(ThisItem.EventDate, Now())

     

    However, I can't seem to figure out how to apply the same concept to the hour / minute picker. Here is the default code that is in the app:

     

    Hour drop down

    ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"]

    Minute drop down

    ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"]

    It works to be able to choose what time just fine, but how would I make it so it reflects the current time (as a starting point to choose from)? I've attached a screen capture. Also, there is not a corresponding data card to the drop down lists for hour/minute.

     

    time.PNG
  • PK_Hong Profile Picture
    337 on at

    Hi @xerxes2985

     

    For Dropdown, you may alwasy use "Default" value and refer to current time.

    eg.: Dropdown.Default = Text(Now(), "hh") for hour, and "mm" for min)

     

    Hope this helps.

     

    Have a nice day.

  • Verified answer
    xerxes2985 Profile Picture
    17 on at

    @PK_Hong 

    Under the drop down control (advanced tab) I've used the following for hour, and left the function line with the standard [00-23] as previously mentioned. - This is working fine.

    Text(Now(), "[$-en-US]hh")

     

     

    However, on the minute one (using the same method and the [00-59]) It seems to be stuck at the default time for the minutes being at 08

    Text(Now(), "[$-en-US]mm")

    Any ideas?

  • Verified answer
    PK_Hong Profile Picture
    337 on at

    Hi @xerxes2985

     

    My correction as I am also unaware of the limitation.

    Anyway, just use Right() function.

     

    Right(Text(Now(), "[$-en-US]hh:mm"), 2),..., to extract right side of hh:mm, to be "mm"

     

    Please refer to documentation:

    > The m or the mm placeholder must appear immediately after the h or hh placeholder or immediately before the ss placeholder. Otherwise, Text returns the month instead of minutes.

     

    Have a nice day

  • BrownMango69 Profile Picture
    25 on at

    @PK_Hong wrote:

    Hi @xerxes2985

     

    My correction as I am also unaware of the limitation.

    Anyway, just use Right() function.

     

    Right(Text(Now(), "[$-en-US]hh:mm"), 2),..., to extract right side of hh:mm, to be "mm"

     

    Please refer to documentation:

    > The m or the mm placeholder must appear immediately after the h or hh placeholder or immediately before the ss placeholder. Otherwise, Text returns the month instead of minutes.

     

    Have a nice day


    I was fumbling for sometime before I found this post about the mm needing the hh - thank you very much!

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 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard