Username or Email
Password
Remember me
Sign in
Sign up
Add Paste
Add Collection
unnamed file
Ruby
timediff
ManiacTwister
Download
Edit
#!/usr/bin/ruby -w
require
"
time
"
def
time_diff
(
time1_str
,
time2_str
)
t
=
Time
.
at
(
Time
.
parse
(
time2_str
)
-
Time
.
parse
(
time1_str
)
)
t
=
(
t
-
t
.
gmt_offset
)
.
strftime
(
"
%H:%M:%S
"
)
puts
t
end
time_diff
(
ARGV
[
0
]
,
ARGV
[
1
])