web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to set current dat...
Power Apps
Unanswered

How to set current date and time as default date time in date picker every time page loads

(0) ShareShare
ReportReport
Posted on by 2

date picker only show cuurent date only not the current time.

Annotation 2019-03-19 183905.jpg

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @alikhan_3 

    You can change the Format property of the DatePicker to DateTimeFormat.ShortDateTime

    Keep in mind though...the Date Picker only deals with dates...not times.

     

    I hope this is helpful.

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @alikhan_3 ,

    Do you want to display current Date value and time value within the DatePicker control?

     

    I have made a test on my side, if you want to display current Date value and time value within the DatePicker control, I afraid that there is no way to achieve your needs in PowerApps currently.

    Currently, within PowerApps, the DatePicker control is mainly used to display a Date value rather than a Date Time value.

    The user @wedwards has faced similar issue with you, please check the response within the following thread:

    https://powerusers.microsoft.com/t5/General-Discussion/Date-Time-Picker-Missing-Time/td-p/49940

     

    As an alternative solution, you could consider take a try to add two Dropdown controls to list the available Hours value and Minutes value mentioned within above thread. I have made a test on my side, please take a try with the following workaround:4.JPG

     

    5.JPG

    Set the Default property of the DatePicker control to following:

    Now() /* <-- Today() */

    Set the Items property of the Hours Dropdown box to following:

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

    Set the Default property of the Hours Dropdown box to following:

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

    Set the Items property of the Minutes Dropdown box to following:

    ["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"]

    Set the Default property of the Minutes Dropdown box to following:

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

    Please take a try with above alternative solution, then check if the issue is solved.

     

    Best regards,

  • batmanMon Profile Picture
    202 on at

    Yay it works 🙂 Thanks fro sharing @v-xida-msft 

  • jbrines Profile Picture
    1,121 on at

    @v-xida-msft 

     

    I have tried the above for Hours and Minutes but it only remembers the first hours and minutes and keeps those as they are. How do I get it to get the latest hours and minutes when I go to the form, I am using the following formula to get to the screen

    NewForm(Sign_In_Form);Navigate(Sign_In_Screen, ScreenTransition.None)

     

    John.

  • Helen_huiyun Profile Picture
    2 on at

    Thanks for sharing! But I also have the similar problem with the problem "it only remembers the first hours and minutes and keeps those as they are", unless I save the form on the page or leave the app. When I cancel the edit on the page, it only remembers the first hours and minutes and keeps those as they are. And this screentransition.none does not work for me. Very confused, two nights searching, not resolved yet.

     

    Save button on the add record page: SubmitForm(AddACKForm)&Back();Set(EGen, false )

    Cancel button on the add record: ResetForm(AddACKForm)&Back();Set(EGen, false)

    Add new record button on another page: NewForm(AddACKForm); Navigate(AddACKPage,ScreenTransition.None)

  • Community Power Platform Member Profile Picture
    on at

    change the defalut value of the data ..and set a formula for it if(true(which firnd u want to show else false one).
    example
    If('food form'.Mode=FormMode.New,Today())

  • Skdkekdkdk Profile Picture
    2 on at

    Hi Helen, did you ever figure this part out? I'm currently having problem having the form reset date and time.

  • Flowwritters Profile Picture
    3 on at

    This worked for me as well. Looked so long for something like this and this worked amazingly! 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard