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
Helper V
Helper V

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/?

Highlighted
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

Highlighted
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

Highlighted
New Member

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

Me too!! ANy answer to this?

Highlighted
Power Apps
Power Apps

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
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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