Skip to content
Advertisement

Javascript Time. Add +1 to current time

Hi I want my timer to continue from the current time each second. Keeping the same time format. I just added a simple code to check.

Code

JavaScript

Advertisement

Answer

Here is the working solution.

You had to split your string that represents time, so you can count the amount of seconds that you actually had.

Note: I’ve used this as help for transitioning from HH:MM:SS to numbers.

And, in the end, you just need to get the timer() string, there is no need to write both time and the return element of timer function.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement