Class DBI::Timestamp
In: lib/dbi/utils/timestamp.rb
Parent: Object

Represents a Timestamp.

DEPRECATED: Please use a regular DateTime object.

Methods

==   fraction   new   to_date   to_s   to_time  

External Aliases

month -> mon
  Aliases
month= -> mon=
day -> mday
day= -> mday=
minute -> min
minute= -> min=
second -> sec
second= -> sec=

Attributes

day  [RW] 
fraction  [W] 
hour  [RW] 
minute  [RW] 
month  [RW] 
second  [RW] 
year  [RW] 

Public Class methods

DBI::Timestamp(year=0,month=0,day=0,hour=0,min=0,sec=0,fraction=nil) DBI::Timestamp(Time) DBI::Timestamp(Date)

Creates and returns a new DBI::Timestamp object. This is similar to a Time object in the standard library, but it also contains fractional seconds, expressed in nanoseconds. In addition, the constructor accepts either a Date or Time object.

Public Instance methods

Returns true if timestamp has a year, month, day, hour, minute, second and fraction equal to the comparing object.

Returns false if the comparison fails for any reason.

Returns fractional seconds, or 0 if not set.

Returns a new Date object based on the year, month and day or, if a Date object was passed to the constructor, returns that object.

Returns a DBI::Timestamp object as a string in YYYY-MM-DD HH:MM:SS format. If a fraction is present, then it is appended in ".FF" format.

Returns a new Time object based on the year, month and day or, if a Time object was passed to the constructor, returns that object.

[Validate]