Skip to content

Instantly share code, notes, and snippets.

@schatteleyn
Created July 26, 2012 09:31
Show Gist options
  • Save schatteleyn/3181213 to your computer and use it in GitHub Desktop.
Save schatteleyn/3181213 to your computer and use it in GitHub Desktop.
Quatrine de Midisix
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