cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Stopwatch control - Press button to record start time and again to record end time and duration

Hi

I am trying to insert a stopwatch into my App.

I have start time, finish time and duration fields that I would like to fill in on each entry in my App.

I would like to push a button that records the time of day and starts a stop watch at the same time.

Then I would like to push another button that records the time of day again and stops the stopwatch entering the duration into my duration field.
I would like all three fields to have entries recorded when I close my App. Start, Finish, Duration.

I know this is a really easy one I am just a fool when it comes to formulas.

I have gone over what the support forum has to offer on time/stopwatch I cannot seem to crack it. I literally need stopwatch formula for dummies right now if possible.

If someone could please give me the formula for this I would greatly appreciate.

Thanks guys

Regards
Lorcan

5 REPLIES 5
Highlighted
Leo09
Level 8

Re: Stopwatch control - Press button to record start time and again to record end time and duration

I don't see any stopwatch control in powerapps, did you mean the timer control here https://powerapps.microsoft.com/en-us/tutorials/control-timer/?

Anonymous
Not applicable

Re: Stopwatch control - Press button to record start time and again to record end time and duration

Hi Leo09

Yes thats my mistake i meant the timer control.

I have a start time, finish time and duration fields that I would like to fill in on each entry in my App.

I would like to push a button that records the time of day in a text box and also starts a timer at the same time.(Which will be saved as duration in another textbox)

I would like to pusha scond button that records the time of day again and stops the timer entering the duration into my duration field/textbox.
I would like all three fields to have entries recorded when I close my App. Start, Finish, Duration.

All I want is a Start time, a finish time and a duration time. I know its really basic. I just cant find the formula.

Regards

Anonymous
Not applicable

Re: Stopwatch control - Press button to record start time and again to record end time and duration

 

Timer.jpgI just want a formula that gives me duration of a time. Thats all.

I have a sharepoint list. I created two columns each under the Date&Time format.

The first one is Start time. I left it as it is.
The second one is Finish Time. I turned the Visible property of the 'Date' part to false. In order to just be left with the time.

All I'd like to do is choose a date and time at the top, and then a few minutes later select a time in the 'Finish Time'.

And automatically for it to show the duration at the bottom.

Is this not possible? Any advice is welcome please.
I have gone over the countdown support forum. Not much help there.

Many thanks

Lorcan

MrJones
Level: Power Up

Re: Stopwatch control - Press button to record start time and again to record end time and duration

Me too!! ANy answer to this?

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Stopwatch control - Press button to record start time and again to record end time and duration

To store start/end times and calculate duration, you can use a pair of buttons ("Start", "End") that stores the current time (via the Now function) in a variable. When you get the end time, you can subtract the value of the two variables to retrieve the duration (in days):

ButtonStart.OnSelect: UpdateContext({ startTime: Now(), duration:Blank() })
ButtonEnd.OnSelect: UpdateContext({ endTime: Now(), duration: endTime - startTime })

If you want to display the duration in hours:minutes:seconds.milliseconds, you can use the Time and Text functions to convert that (by converting the duration from days to milliseconds):

LabelDuration.Text: Text(Time(0, 0, 0, duration * 24 * 60 * 60 * 1000), "hh:mm:ss.fff")

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,684)