struct Time

Superclass hierarchy

Object
Value
Struct
Time

Included Modules

Comparable(self)

Defined in:

Constant Summary

Class Method Summary

Instance Method Summary

Macro Summary

Class Method Detail

def self.days_in_month(year, month)

def self.epoch(seconds : Int, kind = Kind::Unspecified)

def self.epoch_ms(milliseconds : Int, kind = Kind::Unspecified)

def self.leap_year?(year)

def self.local_offset_in_minutes

Returns the local time offset in minutes relative to GMT.

# Assume in Argentina, where it's GMT-3
Time.local_offset_in_minutes #=> -180

def self.local_ticks

def self.new(time : LibC::TimeSpec, kind = Kind::Unspecified)

def self.now

def self.parse(time, pattern, kind = Time::Kind::Unspecified)

def self.utc_now

def self.utc_ticks

def self.new(year, month, day, hour = 0, minute = 0, second = 0, millisecond = 0, kind = Kind::Unspecified)

def self.new(ticks : Int, kind = Kind::Unspecified)

def self.new

Instance Method Detail

def +(other : MonthSpan)

def +(other : TimeSpan)

def -(other : TimeSpan)

def -(other : MonthSpan)

def -(other : Int)

def -(other : Time)

def <=>(other : self)

def add_ticks(value)

def at_beginning_of_day

def at_beginning_of_hour

def at_beginning_of_minute

def at_beginning_of_month

def at_beginning_of_quarter

def at_beginning_of_semester

def at_beginning_of_week

def at_beginning_of_year

def at_end_of_day

def at_end_of_hour

def at_end_of_minute

def at_end_of_month

def at_end_of_quarter

def at_end_of_semester

def at_end_of_week

def at_end_of_year

def at_midday

def date

def day

def day_of_week

def day_of_year

def epoch

Returns the number of seconds since the Epoch


def epoch_f

def epoch_ms

def friday?

def hash

def hour

def inspect(io : IO)

def kind

def local?

def millisecond

def minute

def monday?

def month

def saturday?

def second

def sunday?

def thursday?

def ticks

def time_of_day

def to_local

def to_s(format : String)

def to_s(format : String, io : IO)

def to_utc

def tuesday?

def utc?

def wednesday?

def year

Macro Detail

macro def_at(name)