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

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

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

Annotation 2019-03-19 183905.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

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

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

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

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Community Support
Community Support

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

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

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

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (10,286)