/ruby/gigasecond/gigasecond.rb

1
2
3
4
5
class Gigasecond
  def self.from(dob)
    (dob.to_time + 10**9).to_date
  end
end

@clupasq thinks this looks great

Comments

Simplified after seeing other submissions and realising I don't need some of the fluff like Time.at and to_i. Also removed return statement.

helenst commented 4 January 2015 at 11:18 UTC

You're not logged in right now. Please login via GitHub to comment