Created
July 26, 2012 09:31
-
-
Save schatteleyn/3181213 to your computer and use it in GitHub Desktop.
Quatrine de Midisix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'time' | |
t = Time.now | |
h = t.hour | |
m = t.min | |
a = 1 | |
d = h - 9 | |
if d >= 0 | |
x = a + d | |
elsif d < 0 | |
x = a + (d+24) | |
end | |
puts "Il est #{x}rine de #{"%02d" % h}h#{"%02d" % m}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment