title: kotlin clock & timer
body: <p>I have a timer and I want to connect the timer time to a clock to let the user see at what time the timer will stop.</p>
  <p>For example the timer start at 12:28pm and will finish after 12 min at 12:40pm</p>
  <p>How can I do this in Kotlin.</p>
  <p>This the code</p>
  <pre><code>val timer = object : CountDownTimer(20000, 1000) {
          override fun onTick(millisUntilFinished: Long) {
  
              var diff = millisUntilFinished
              val secondsInMilli: Long = 1000
              val minutesInMilli = secondsInMilli * 60
              val elapsedMinutes = diff / minutesInMilli
              diff %= minutesInMilli
  
              var currentclock : TextClock
              var clockfinish : TextClock
              
             textview1.text = &quot;$elapsedMinutes min&quot;
  
          }
  
          override fun onFinish() {
              textview1.text = &quot;Your time is up&quot;
  
          }
      }
      timer.start()
  </code></pre>
  <p>How can I connect the timer time to <strong>clockfinish</strong> .</p>