D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Time
/
Filename :
at-c.ri
back
Copy
U:RDoc::AnyMethod[iI"at:ETI" Time::at;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I">Returns a new +Time+ object based on the given arguments.;To:RDoc::Markup::BlankLine o; ; [I"/Required argument +time+ may be either of:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"FA +Time+ object, whose value is the basis for the returned time; ;TI"Dalso influenced by optional keyword argument +in:+ (see below).;To;;0; [o; ; [I"A numeric number of ;TI"2{Epoch seconds}[rdoc-ref:Time@Epoch+Seconds] ;TI"for the returned time.;T@o; ; [I"Examples:;T@o:RDoc::Markup::Verbatim; [I"Kt = Time.new(2000, 12, 31, 23, 59, 59) # => 2000-12-31 23:59:59 -0600 ;TI";secs = t.to_i # => 978328799 ;TI"KTime.at(secs) # => 2000-12-31 23:59:59 -0600 ;TI"MTime.at(secs + 0.5) # => 2000-12-31 23:59:59.5 -0600 ;TI"KTime.at(1000000000) # => 2001-09-08 20:46:40 -0500 ;TI"KTime.at(0) # => 1969-12-31 18:00:00 -0600 ;TI"KTime.at(-1000000000) # => 1938-04-24 17:13:20 -0500 ;T:@format0o; ; [I"MOptional numeric argument +subsec+ and optional symbol argument +units+ ;TI"@work together to specify subseconds for the returned time; ;TI"7argument +units+ specifies the units for +subsec+:;T@o;; ;;[o;;0; [o; ; [I".+:millisecond+: +subsec+ in milliseconds:;T@o;; [ I"GTime.at(secs, 0, :millisecond) # => 2000-12-31 23:59:59 -0600 ;TI"ITime.at(secs, 500, :millisecond) # => 2000-12-31 23:59:59.5 -0600 ;TI"GTime.at(secs, 1000, :millisecond) # => 2001-01-01 00:00:00 -0600 ;TI"GTime.at(secs, -1000, :millisecond) # => 2000-12-31 23:59:58 -0600 ;T;0o;;0; [o; ; [I"9+:microsecond+ or +:usec+: +subsec+ in microseconds:;T@o;; [ I"JTime.at(secs, 0, :microsecond) # => 2000-12-31 23:59:59 -0600 ;TI"LTime.at(secs, 500000, :microsecond) # => 2000-12-31 23:59:59.5 -0600 ;TI"JTime.at(secs, 1000000, :microsecond) # => 2001-01-01 00:00:00 -0600 ;TI"JTime.at(secs, -1000000, :microsecond) # => 2000-12-31 23:59:58 -0600 ;T;0o;;0; [o; ; [I"7+:nanosecond+ or +:nsec+: +subsec+ in nanoseconds:;T@o;; [ I"LTime.at(secs, 0, :nanosecond) # => 2000-12-31 23:59:59 -0600 ;TI"NTime.at(secs, 500000000, :nanosecond) # => 2000-12-31 23:59:59.5 -0600 ;TI"LTime.at(secs, 1000000000, :nanosecond) # => 2001-01-01 00:00:00 -0600 ;TI"LTime.at(secs, -1000000000, :nanosecond) # => 2000-12-31 23:59:58 -0600 ;T;0o; ; [I"HOptional keyword argument <tt>in: zone</tt> specifies the timezone ;TI"for the returned time:;T@o;; [I"@Time.at(secs, in: '+12:00') # => 2001-01-01 17:59:59 +1200 ;TI"@Time.at(secs, in: '-12:00') # => 2000-12-31 17:59:59 -1200 ;T;0o; ; [I"+For the forms of argument +zone+, see ;TI">{Timezone Specifiers}[rdoc-ref:Time@Timezone+Specifiers].;T: @fileI" timev.rb;T:0@omit_headings_from_table_of_contents_below000[ I"9(time, subsec = false, unit = :microsecond, in: nil);T@aFI" Time;TcRDoc::NormalClass00