This practice will be retired on May 31, 2020.
Challenge: Formatting Time0:51 with Pasan Premaratne
Take a time value that I've provided, in seconds, and convert that to hours, minutes and seconds.
[MUSIC] 0:00 In this exercise, we're going to tackle a task that comes up quite often. 0:04 In programming, time is often measured in seconds, but 0:09 people aren't accustomed to reading it that way. 0:12 Your task is to take a time value that I've provided here, in seconds, and 0:15 convert that to hours, minutes, and seconds. 0:20 Use these values to then create a string literal 0:24 describing what the formatted time reads as. 0:27 Now I've provided an example here. 0:30 So you can see the final string would look something like this, 0:31 9700 seconds is 2 hours, 41 minutes and 40 seconds. 0:35 So to get this playground, go to the teacher's notes, grab it, and 0:40 then get started. 0:43 Also included are links to videos in case you get stuck. 0:44 In the next video, I'll go over my solution. 0:48
You need to sign up for Treehouse in order to download course files.Sign up