Initializing timer with some start value.
Hi,
I came across this easy to use task-timer a few days back, it's really wonderful. I want to show elapsed time in hh:mm:ss format, which I could show. But now when I have to give some start-time to timer, it is not showing perfect time. I wanted to initialize the start time to 4 seconds so, I wrote the code below:
<timer interval='1000', start-time='4000'> {{hhours}}:{{mminutes}}:{{sseconds}}</timer>
The code above doesn't seem to work as timer takes some wrong value as shown below:
12:09:28 Can some one tell me why it happens or there is certainly something wrong in my syntax? Plus can we change the start time of the task timer to some value dynamically?
Thanks, Supriya
The issue is that it is passing the value of start-time to moment which is seeing it as the number of milliseconds in a Unix timestamp. This means that you are some time in 1970
"Angular-timer" probably uses UNIX Timestamp.
start-time translate the given parameter to milliseconds since 1970-01-01 00:00:00