Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def convertSeconds(time: Int): String = {
- val secondsInHour = 3600
- val secondsInMinute = 60
- val hours = time / secondsInHour
- val minutes = (time % secondsInHour) / secondsInMinute
- val seconds = (time % secondsInHour) % secondsInMinute
- s"h: $hours, m: $minutes, s: $seconds"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement