=head1 NAME ORM::Date - Date handler class. =head1 SYNOPSIS $date = ORM::Date->new( [ 2006, 1, 25 ] ); print $date->mysql_date,"\n"; $date = $date->diff( [ 0, 0, -2 ] ); print $date->mysql_date,"\n"; The output is: 2006-01-25 2005-11-25 =head1 DESCRIPTION This class introduces minimal interface to handle database table fields of type 'DATE'. It can be used to store time alogn with date, but ORM uses class C to handle fields of type DATETIME. Please also consult L to be sure you know how these classes are used by ORM. If you want to use another class to handle 'DATE' fields, please consult: =over =item * L (THIRD PARTY CLASSES) =item * L (C<_db_type_to_class> method). =item * L. =back =head1 CONSTRUCTORS =over =item new( [ $year, $month, $mday, $hour, $min, $sec ] ) Create new C object as specified in array reference. C<$year> should be exact four digit value. C<$month> is number in range between 1 and 12. If some value is out of range then it is treated as in C syscall, e.g. C<[2005,10,15,25,15,00]> is the same as C<[2005,10,16,01,15,00]>. =item new_epoch( $seconds_since_epoch ) Create date object from value of seconds since epoch (as returned by C