Flávio Soibelmann Glock > DateTime-Incomplete-0.07 > DateTime::Incomplete

Download:
DateTime-Incomplete-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  2
View/Report Bugs
Module Version: 0.07   Source  

NAME ^

DateTime::Incomplete - An incomplete datetime, like January 5

SYNOPSIS ^

  my $dti = DateTime::Incomplete->new( year => 2003 );
  # 2003-xx-xx
  $dti->set( month => 12 );
  # 2003-12-xx
  $dt = $dti->to_datetime( base => DateTime->now );
  # 2003-12-19T16:54:33

DESCRIPTION ^

DateTime::Incomplete is a class for representing partial dates and times.

These are actually encountered relatively frequently. For example, a birthday is commonly given as a month and day, without a year.

ERROR HANDLING ^

Constructor and mutator methods (such as new and set) will die if there is an attempt to set the datetime to an invalid value.

Invalid values are detected by setting the appropriate fields of a "base" datetime object. See the set_base method.

Accessor methods (such as day()) will return either a value or undef, but will never die.

THE "BASE" DATETIME ^

A DateTime::Incomplete object can have a "base" DateTime.pm object. This object is used as a default datetime in the to_datetime() method, and it also used to validate inputs to the set() method.

The base object must use the year/month/day system. Most calendars use this system including Gregorian (DateTime) and Julian. Note that this module has not been well tested with base objects from classes other than DateTime.pm class.

By default, newly created DateTime::Incomplete objects have no base.

DATETIME-LIKE METHODS ^

Most methods provided by this class are designed to emulate the behavior of DateTime.pm whenever possible.

"Get" Methods

Computed Values

All other accessors, such as day_of_week(), or week_year() are computed from the base values for a datetime. When these methods are called, they return the requested information if there is enough data to compute them, otherwise they return undef

Unimplemented Methods

The following DateTime.pm methods are not implemented in DateTime::Incomplete, though some of them may be implemented in future versions:

"Set" Methods

"DATETIME::INCOMPLETE" METHODS ^

DateTime::Incomplete objects also have a number of methods unique to this class.

SUPPORT ^

Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details.

AUTHORS ^

Flavio S. Glock <fglock[at]cpan.org>

With Ben Bennett <fiji[at]ayup.limey.net>, Claus Farber <claus[at]xn--frber-gra.muc.de>, Dave Rolsky <autarch[at]urth.org>, Eugene Van Der Pijll <pijll[at]gmx.net>, Rick Measham <rick[at]isite.net.au>, and the DateTime team.

COPYRIGHT ^

Copyright (c) 2003 Flavio S. Glock. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO ^

datetime@perl.org mailing list

http://datetime.perl.org/

syntax highlighting: