NAME
Rose::DateTime::Parser - DateTime parser object.
SYNOPSIS
use Rose::DateTime::Parser;
$parser = Rose::DateTime::Parser->new(time_zone => 'UTC');
$dt = $parser->parse_date('4/30/2001 8am')
or warn $parser->error;
DESCRIPTION
Rose::DateTime::Parser
encapsulates a particular kind of call to Rose::DateTime::Util::parse_date()
. The object maintains the desired time zone, which is then passed to each call to parse_date()
.
This class inherits from, and follows the conventions of, Rose::Object
. See the Rose::Object
documentation for more information.
CONSTRUCTOR
- new PARAMS
-
Constructs a new
Rose::DateTime::Parser
object based on PARAMS, where PARAMS are name/value pairs. Any object method is a valid parameter name.
OBJECT METHODS
- error [ERROR]
-
Get or set the error message string.
- parse_date STRING
-
Attempt to parse STRING by passing it to
Rose::DateTime::Util::parse_date()
. If parsing is successful, the resultingDateTime
object is returned. Otherwise,error()
is set and false is returned. - parse_datetime STRING
-
Alias for
parse_date()
- time_zone [STRING]
-
Get or set the time zone string passed to
Rose::DateTime::Util::parse_date()
. Defaults toRose::DateTime::Util->time_zone
.
AUTHOR
John C. Siracusa (siracusa@mindspring.com)
COPYRIGHT
Copyright (c) 2004 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.