Method: Time.at
- Defined in:
- lib/source/ruby.rb
.at(seconds, milliseconds) ⇒ Object
call-seq:
Time.at(a_time) -> time
Time.at(seconds [, microseconds]) -> time
Creates a new time object with the value given by a_time, or the given number of seconds (and optional milliseconds) from epoch. A non-portable feature allows the offset to be negative on some systems.
Time.at(0) #=> Wed Dec 31 1969 19:00:00 GMT-0500 (EST)
Time.at(946702800) #=> Sat Jan 01 2000 00:00:00 GMT-0500 (EST)
Time.at(-284061600) #=> Sat Dec 31 1960 01:00:00 GMT-0500 (EST)
6314 6315 6316 6317 6318 |
# File 'lib/source/ruby.rb', line 6314 def self.at(seconds,milliseconds) `var t=c$Time.m$new()` `t.__value__=typeof(seconds)=='number'?new(Date)(seconds*1000+(milliseconds||0)):seconds.__value__` return `t` end |