ORM::Datetime - Date and time handler class.


ORM documentation  | view source Contained in the ORM distribution.

Index


NAME

Top

ORM::Datetime - Date and time handler class.

SYNOPSIS

Top

  $date = ORM::Datetime->new( [ 2006, 1, 25, 10, 0, 0 ] );
  print $date->mysql_datetime,"\n";
  $date = $date->diff( [ 0, 0, -2, 0, 0, -70 ] );
  print $date->mysql_datetime,"\n";

  The output is:
  2006-01-25 10:00:00
  2005-11-25 09:58:50

DESCRIPTION

Top

This class introduces minimal interface to handle database table fields of type 'DATETIME'. This class is descendant of <ORM::Date> and behaves almost the same with few differences.

To see interface of the class please refer to ORM::Date. Members that behaves different than in ORM::Date are listed below:

CONSTRUCTORS

Top

current()

Create date object corresponding to current date and time. Opposite to ORM::Date hour, minutes and seconds values are set to current and not to zeroes.

earlier24h()

Create date object corresponding to yesterday date and current time. Opposite to ORM::Date hour, minutes and seconds values are set to current and not to zeroes.

SEE ALSO

Top

ORM::Date

ORM::Meta::ORM::Datetime

AUTHOR

Top

Alexey V. Akimov

COPYRIGHT AND LICENSE

Top


ORM documentation  | view source Contained in the ORM distribution.