Advertisement
Guest User

Untitled

a guest
Sep 6th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.28 KB | None | 0 0
  1. def convertSeconds(time: Int): String = {
  2.     val secondsInHour = 3600
  3.     val secondsInMinute = 60
  4.     val hours = time / secondsInHour
  5.     val minutes = (time % secondsInHour) / secondsInMinute
  6.     val seconds = (time % secondsInHour) % secondsInMinute
  7.     s"h: $hours, m: $minutes, s: $seconds"
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement