Class RiCal::FastDateTime
In: lib/ri_cal/fast_date_time.rb
Parent: Object
  • ©2009 Rick DeNatale
  • All rights reserved. Refer to the file README.txt for the license
 FastDateTime mimics the Ruby Standard library DateTime class but avoids the use of Rational
 Instead of using a Rational for the utc offset, FastDateTime uses an integer seconds value

Methods

Included Modules

Comparable

Constants

SECONDS_IN_A_DAY = 60*60*24 unless defined? SECONDS_IN_A_DAY

External Aliases

offset -> utc_offset_seconds

Attributes

date  [RW] 
hour  [RW] 
min  [RW] 
offset  [RW] 
sec  [RW] 
secs_since_bod  [RW] 

Public Class methods

Public Instance methods

Return a new FastDateTime based on the receiver but with changes specified by the options

def jd

  date.jd

end

inspect()

Alias for to_s

mon()

Alias for month

e.g. to obtain the 3nd Tuesday of the receivers month use

  time.nth_wday_in_month(2, 2)

e.g. to obtain the 2nd Monday of the receivers year use

  time.nth_wday_in_year(2, 1)

Return a DateTime which is the beginning of the first day on or before the receiver with the specified wday

def new_offset(ofst)

  if ofst == offset
    self
  else
    advance(:seconds => offset - ofset, :offset => ofst)
  end

end

[Validate]