hour_minute_second

You have to convert the given time (seconds) into the following format..hour:minute:second

IN

123

OUT

0:2:3
Login to submit solution


5 symbols php
Thu Feb 12 20:22:29 2015 PFischbeck
0:2:3
5 symbols php
Sun Jul 10 17:09:43 2016 Katie Gardner
0:2:3
5 symbols php
Sat Apr 29 19:00:52 2017 joshlotriet
0:2:3
6 symbols pyth
Tue Oct 18 22:13:15 2016 Sait2000
"0:2:3
10 symbols bash
Wed Jul 27 06:47:12 2016 hidefromkgb
echo 0:2:3
18 symbols haskell
Fri Mar 13 14:12:47 2015 YoshikuniJujo
main=putStr"0:2:3"
20 symbols haskell
Sat Feb 28 07:15:46 2015 bluebear94
main=putStrLn"0:2:3"
55 symbols python2
Thu Feb 12 21:35:24 2015 z423x5c6
a=input()
print":".join(map(str,[a/3600,a/60%60,a%60]))
55 symbols python2
Thu Feb 4 19:01:47 2016 felixbade
s=input()
print':'.join(map(str,[s/3600,s/60%60,s%60]))
57 symbols python2
Thu Feb 12 20:27:29 2015 PFischbeck
i=input()
print":".join(map(str,[i/3600,i%3600/60,i%60]))
62 symbols perl
Thu Feb 12 20:30:27 2015 danieljabailey
#!/usr/bin/perl -p
$a=$_%3600;$c=$a%60;$_=(($_-$a)/3600).":".(($a-$c)/60).":$c"
64 symbols python3
Thu Feb 12 21:34:23 2015 z423x5c6
a=int(input())
print(':'.join(map(str,[a//3600,a//60%60,a%60])))
65 symbols python3
Fri Feb 27 05:08:39 2015 bluebear94
a=eval(input())
print(":".join(map(str,[a//3600,a//60%60,a%60])))
67 symbols python2
Thu Feb 4 18:58:17 2016 felixbade
s=input()
m,s=divmod(s,60)
h,m=divmod(m,60)
print'%d:%d:%d'%(h,m,s)
157 symbols ruby
Tue Sep 20 12:58:18 2016 JJonesJr
inp= gets.chomp.to_i;
str= "#{(inp/60**2).to_s}";
inp= (inp % (60**2)).to_s;
str += ":#{inp.to_i/60}";
inp= (inp.to_i % 60).to_s;
str += ":#{inp}";
puts str;
162 symbols python3
Thu Feb 12 20:14:13 2015 Dhruv Shah
t = 123
hr = int(t/3600)
mn = (t%3600)/60
    
    
mn_int = int(mn)
sec = (t%3600)%60
    
h_m_s = (str(hr)+str(":")+str(mn_int)+str(":")+str(sec))
print(h_m_s)

View all solutions