This timer displays up to 59 minutes. I wanted to set up a timer for two hours, so I changed (‘%M:%S’) to (%H:%M:%S’).
Now the timer would count down from more than 59 minutes, but for some reason it would add 4 hours to the displayed time. It would count down for the correct amount of time, but it would just add 4 hours to what is displayed.
For example, if I wanted a timer for 5 minutes, it would display 4:05:00 and start counting down until the five minutes pass at 4:00:00, then it would reset. If I wanted a timer for 1.5 hours, it would display 5:30:00 and count down from there until 1.5 hours pass and reach 4:00:00 and then reset.
Can some one help me so it displays the correct time?
The 4 hour discrepancy you saw was your local timezone offset. The second parameter in timestamp_custom determines how it handles timezone (it’s true by default).