class

Ruby::V4::DateTime

Inherits Ruby::V4::Date < Comparable < Reference < Object

Constructors

civil(year : Int, mon = 1, day = 1, hour = 0, min = 0, sec = 0, offset : Int | String = 0) : self
Source
iso8601(str : String) : self
Source
jd(jd : Int, hour = 0, min = 0, sec = 0, offset : Int | String = 0) : self
Source
new(jd : Int64, daysec : Int32 = 0, offset : Int32 = 0)
Source
parse(str : String) : self

DateTime.parse — ISO-подобные строки с временем и офсетом.

Source

Instance methods

+(days : Int) : DateTime
Source
-(days : Int) : DateTime
Source
daysec
Source
hour
Source
inspect

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.

Source
new_offset(offset : Int | String) : self

Смена зоны с сохранением момента: стенное время сдвигается на разницу офсетов (новый − старый).

Source
offset
Source
to_date
Source
to_s

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.

Source
to_s_full
Source
to_time

Тот же момент в зоне с собственным офсетом даты-времени (Ruby >= 2.5: DateTime#to_time сохраняет офсет).

Source