I'm using CountdownTimer
in my app to display remaining time until specific Date
. But Date
is only 2 hours from current time, but if I convert millisUntilFinished
to hours, it says 9 hours. Date
is in UTC format.
remainingTimer = object : CountDownTimer(dateTime.time, 1000) {
override fun onTick(millisUntilFinished: Long) {
remTime = millisUntilFinished
notifyChanged(PAYLOAD_UPDATE_REM_TIME)
}
override fun onFinish() {
swapTimers()
}
}.start()
val hours = ((remTime / (1000 * 60 * 60)).rem(24))