Ruby::V4::Time
Inherits Comparable < Reference < Object
Constants
Constructors
Time.at(sec, frac, unit): :millisecond / :usec / :nanosecond.
Time.at — локальное время (как в Ruby): Time.at(0).to_s в MSK даёт "1970-01-01 03:00:00 +0300".
Time.new(...) — сейчас; Time.new(y, m, d, h, min, s, zone); zone: строка "+05:30"/"-03:00"/"UTC", либо Int-офсет в секундах.
strptime: %Y %m %d %y %H %M %S (жадно, без ведущего нуля — как Date._strptime: %H читает и "7", и "07") + буквальные символы. Результат — локальное время.
Class methods
Instance methods
round/ceil с точностью digits знаков субсекунды, half-up с переносом в секунду (Ruby: Time#round(3) у 0.999999999 → 1.000000000).
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.