Last active
August 29, 2015 14:17
-
-
Save kotp/210e00496fbb6efe4e93 to your computer and use it in GitHub Desktop.
Result of refactoring other code, uses time library and features a proc.
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' | |
get_time = ->(t) { [t.iso8601, t.usec] } | |
report = 'something to report with a detailed time: %s' | |
puts report % get_time[Time.now] | |
DouglasAllen
commented
Apr 2, 2015
#test.rb
require_relative 'ctime'
puts "Time now is #{get_time}"
puts "#{e_sec} seconds since January 1, 1970"
t1 = Time.new(1970,01,01,0,0,0, "+00:00")# is there something else in Ruby Time to get this?
puts "Time now is #{t1 + e_sec}"
puts "#{system 'date'}"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment