logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

DateTime::Format::DateParse - Parses Date::Parse compatible formats

Author

       Joshua Hoblitt (JHOBLITT) <jhoblitt@cpan.org>

Credits

       Graham Barr (GBARR) <gbarr@pobox.com>, author of Date::Parse

       Everyone at the DateTime "Asylum".

Description

       This module is a compatibility wrapper around Date::Parse.

Gotchas

       •   If  parse_datetime  is  called  on a $date that doesn't know specify a timezone and $zone is not set,
           then the timezone of the returned DateTime object will be set  to  the  "local"  timezone.   This  is
           consistent with the behavior of Date::Parse.

       •   If parse_datetime is called without a $zone but the $date string does specify a timezone/offset or if
           parse_datetime  is  called  with  a  $zone  that DateTime::TimeZone does not understand, the returned
           DateTime object will have it's timezone set to a fixed  offset  from  UTC.   This  means  that  "DST"
           information  is not available and date math will not reflect "DST" transitions.  This may be resolved
           for true timezones by using the DateTime::TimeZone::Alias module to "alias" the  Time::Zone  timezone
           to an Olson DB name.  This may be done automatically in a future release.

Name

       DateTime::Format::DateParse - Parses Date::Parse compatible formats

See Also

       Date::Parse,       Time::Zone,       DateTime,       DateTime::TimeZone,       DateTime::TimeZone::Alias,
       <http://datetime.perl.org/>

perl v5.34.0                                       2022-06-13                   DateTime::Format::DateParse(3pm)

Support

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

Synopsis

           use DateTime::Format::DateParse;

           my $dt = DateTime::Format::DateParse->parse_datetime( $date );
           my $dt = DateTime::Format::DateParse->parse_datetime( $date, $zone );

Usage

ImportParameters
       This module accepts no arguments to it's "import" method and exports no symbols.

   MethodsClassMethods

       •   parse_datetime($date [, $zone])

           Accepts a Date::Parse compatible $date string and optionally a Time::Zone compatible $zone string.

           Returns a DateTime object.

See Also