Я также был бы в порядке, если бы был способ просто разделить заданное число на 1800, поскольку он также дал бы мне цифры, которые мне нужны.
спасибо. PrettyPrint-Override ">
Код: Выделить всё
function countup(startingdate, base) {
this.currentTime = new Date()
this.startingdate = new Date(startingdate)
this.base = base
this.start()
}
countup.prototype.oncountup = function() {}
countup.prototype.start = function() {
var thisobj = this
this.currentTime.setSeconds(this.currentTime.getSeconds() + 1)
var timediff = (this.currentTime - this.startingdate) / 1000
var secondfield = Math.floor((timediff))
var result = {
seconds: secondfield
}
this.oncountup(result)
setTimeout(function() {
thisobj.start()
}, 1000)
}
var startDate = new countup("June 22, 2025 15:30:00", "seconds")
startDate.oncountup = function(result) {
var mycountainer = document.getElementById("holder")
mycountainer.innerHTML = +result['seconds']
}< /code>
Подробнее здесь: https://stackoverflow.com/questions/796 ... ad-of-ever
Мобильная версия