GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ROSE::DATETIME::PARSER (3)

.ds Aq ’

NAME

Rose::DateTime::Parser - DateTime parser object.

CONTENTS

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’s parse_date and parse_european_date functions. The object maintains the desired time zone, which is then passed to each call.

This class inherits from, and follows the conventions of, Rose::Object. See the Rose::Object documentation for more information.

CONSTRUCTOR

<B>new PARAMSB> 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

<B>error [ERROR]B> Get or set the error message string.
<B>european [BOOL]B> Get or set a boolean value that controls how the parse_date method will interpret xx/xx/xxxx dates: either month/day/year or year/month/day.

If true, then the parse_date method will pass its arguments to Rose::DateTime::Util’s parse_european_date function, which interprets such dates as dd/mm/yyyy.

If false, then the parse_date method will temporarily <B>forceB> non-European date parsing and then call Rose::DateTime::Util’s parse_date function, which will interpret the date as mm/dd/yyyy.

This attribute defaults to the value returned by the Rose::DateTime::Util->european_dates class method called at the time the Rose::DateTime::Parser object is constructed.

If the BOOL argument is undefined (instead of false, but defined) then the attribute will return to its default value by calling the Rose::DateTime::Util->european_dates class method again. To unambiguously set the attribute to true or false, pass a defined value like 1 or 0.

<B>parse_date STRINGB> Attempt to parse STRING by passing it to Rose::DateTime::Util’s parse_date or parse_european_date function. The choice is controlled by the european attribute.

If parsing is successful, the resulting DateTime object is returned. Otherwise, error is set and false is returned.

<B>parse_datetime STRINGB> This method is an alias for parse_date()
<B>parse_european_date STRINGB> Attempt to parse STRING by passing it to Rose::DateTime::Util’s parse_european_date function (regardless of the value of the european attribute). If parsing is successful, the resulting DateTime object is returned. Otherwise, error is set and false is returned.
<B>time_zone [STRING]B> Get or set the time zone string passed to Rose::DateTime::Util’s parse_date function. Defaults to the value returned by the Rose::DateTime::Util->time_zone class method.

AUTHOR

John C. Siracusa (siracusa@gmail.com)

LICENSE

Copyright (c) 2010 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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ROSE::DATETIME::PARSER (3) 2010-03-23

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.