cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wedwards
Level: Powered On

Date Time Picker -- Missing Time

I added the Date control to a card but the time portion is not present.  I am using the current version of PowerApps.

What should I do to be able to also choose a time?  I am using the Web version on a PC if that affects my view.

 

Thank you,

 

 

W.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Date Time Picker -- Missing Time

Hi @wedwards,

 

The DatePicker control is only available for Date, there is no time control available under PowerApps.

To workaround this, we need to add two dropdown, one for hour, and another for Minutes

HourDropdown:

Items property (24 hours):

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

MinutesDropdown:

Items property:

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

Together with the DatePicker control, within one DataCard, then use the following formula to combine the time value with the date value under the Update property of the DataCard control:

DateValue1.SelectedDate + Time(Value(HourDropdown.Selected.Value), Value(MinutesDropdown.Selected.Value), 0)

Reference:

86.PNG

 

Regards,

Michael

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

Re: Date Time Picker -- Missing Time

Hi @wedwards,

 

The DatePicker control is only available for Date, there is no time control available under PowerApps.

To workaround this, we need to add two dropdown, one for hour, and another for Minutes

HourDropdown:

Items property (24 hours):

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

MinutesDropdown:

Items property:

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

Together with the DatePicker control, within one DataCard, then use the following formula to combine the time value with the date value under the Update property of the DataCard control:

DateValue1.SelectedDate + Time(Value(HourDropdown.Selected.Value), Value(MinutesDropdown.Selected.Value), 0)

Reference:

86.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
wedwards
Level: Powered On

Re: Date Time Picker -- Missing Time

That worked perfectly. 

 

I like this solution a lot because I actually wanted to restrict the minutes to every 15 or 30 minutes, so I was able to achieve that.

 

Minutes property:

["00","15","30","45"] or ["00","30"] 

 

Thank you,

 

W.

sblake
Level: Powered On

Re: Date Time Picker -- Missing Time

I did this by using a Label and Slider.

 

Slider called sldTimer

 

The Min property of sldTimer to 0

The Max property of the sldTimer to the number of increments of the time in a 24 hour period you want to jump. In my example I wanted to go up by 5 minute intervals so just quickly calculated how many 5 minutes there are in 24 hours:

 

Number of increments = 24*60/5

 

Label called lblTime

 

set Text property of lblTime to:

 

Text(Time(RoundDown((sldTimer.Value * 5)/60,0), Mod(sldTimer.Value * 5, 60) - Mod(Mod(sldTimer.Value * 5, 60), 5), 00), "[$-en-US]HH:mm AM/PM")

 

for the above the 5 represents the time increment I am looking for and 60 is the number of minutes in an hour.

 

Obviously some of the maths would change if you want it to go up by seconds, or you just want to create a timer between two specific times, but not difficult to extrapolate the above.

 

Capture.PNG

 

 

 

Boneckrh19
Level: Powered On

Re: Date Time Picker -- Missing Time

Michael I love your solution, although what do you recommend for a version of this that uses am and pm? Is there an efficent way to have a time picker that goes to 12 and then starts over, or one with an am/pm option?