Skip to content

Instantly share code, notes, and snippets.

@dpk dpk/gist:4346535

Created Dec 20, 2012
Embed
What would you like to do?
French Republican calendar: decimal time
#!/usr/bin/env ruby
def dectime
t = Time.now
daysec = t.hour * 3600 + t.min * 60 + t.sec
h = (daysec / 8640.0).floor
m = ((daysec / 86.4) % 100).floor
s = ((daysec / 0.864) % 100).floor
[h,m,s]
end
puts dectime.join(':') if __FILE__ == $0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.