cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alikhan_3
Level: Power Up

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
Community Support Team
Community Support Team

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
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.
Community Support Team
Community Support Team

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
batmanMon
Level: Powered On

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,908)