This question has already been answered:
Hello. I just started to learn javascript, and in this process there was a little problem that at the moment I cannot solve.
So 24h is given, the initial price (say 1000), the final price (say 6000). -> difference (5000).
The goal is to get a function that will increase the price (every second) starting from 1000 and ending with 6000 (by 5000) until these 24 hours pass. All the time manipulations I do in the format. I think time is so
var countDownDate = new Date($timestamp['created_at')); countDownDate.setHours(countDownDate.getHours() + 24); var now = new Date().getTime(); var distance = countDownDate - now; Krivorukost does not allow me to find decent information on this issue in Google, for this I ask you to kick links, possible solutions, etc., etc. Thanks in advance!