Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/System-time/Ruby/system-time.rb
Normal file
13
Task/System-time/Ruby/system-time.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
t = Time.now
|
||||
|
||||
# textual
|
||||
puts t # => 2013-12-27 18:00:23 +0900
|
||||
|
||||
# epoch time
|
||||
puts t.to_i # => 1388134823
|
||||
|
||||
# epoch time with fractional seconds
|
||||
puts t.to_f # => 1388134823.9801579
|
||||
|
||||
# epoch time as a rational (more precision):
|
||||
puts Time.now.to_r # 1424900671883862959/1000000000
|
||||
Loading…
Add table
Add a link
Reference in a new issue