DateTi...teParse(3pm)
π NAME π
DateTime::Format::DateParse β the module that parses Date::Parse-compatible formats, no cap. Fr fr it's a compatibility wrapper, and it lives over in the User Contributed Perl Documentation corner of the man pages π
β¨ SYNOPSIS β¨
use DateTime::Format::DateParse;
my $dt = DateTime::Format::DateParse->parse_datetime( $date );
my $dt = DateTime::Format::DateParse->parse_datetime( $date, $zone );
That's literally it. Two lines of code and you're slaying π¦
πΈ DESCRIPTION πΈ
So basically: this module is a compatibility wrapper around Date::Parse. That's the whole vibe. It doesn't reinvent anything, it just makes Date::Parse play nicely with DateTime, and honestly? Iconic behaviour π«Ά
π USAGE π
π Import Parameters π
This module accepts no arguments at all to its import method, and it exports zero symbols. Nothing. Nada. So don't come at it with a big import list, she's not that kind of girl π
π Methods π
π Class Methods π
parse_datetime($date [, $zone])β takes a Date::Parse-compatible$datestring, and optionally a Time::Zone-compatible$zonestring. It hands you back aDateTimeobject. That's the whole deal, and it eats every time π
π GOTCHAS π
Bestie, read these. They will absolutely catch you out if you skip them π
- If
parse_datetimegets called on a$datethat doesn't specify a timezone and$zoneis not set, then the timezone of the returnedDateTimeobject gets set to thelocaltimezone. This is consistent with the behaviour ofDate::Parseβ so it's not a bug, it's a vibe match π§ - If
parse_datetimeis called without a$zonebut the$datestring does specify a timezone/offset β or ifparse_datetimeis called with a$zonethatDateTime::TimeZonedoes not understand β then the returnedDateTimeobject will have its timezone set to a fixed offset from UTC. Which means: noDSTinformation is available, and date math will not reflectDSTtransitions. Lowkey a big deal for date math, ngl. This may be resolved for true timezones by using theDateTime::TimeZone::Aliasmodule to "alias" theTime::Zonetimezone to an Olson DB name. And this may be done automatically in a future release β¨
π CREDITS π
- Graham Barr (GBARR)
<gbarr@pobox.com>β author ofDate::Parseπ - Everyone at the DateTime "Asylum" π«Ά
π¬ SUPPORT π¬
Support for this module is provided via the <datetime@perl.org> email list. See <http://lists.perl.org/> for more details π
π¦ AUTHOR π¦
Joshua Hoblitt (JHOBLITT) <jhoblitt@cpan.org>
β COPYRIGHT β
Copyright (c) 2005-6 Joshua Hoblitt. 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 licenses can be found in the LICENSE file included with this module, or in perlartistic and perlgpl as supplied with Perl 5.8.1 and later π
πΈ SEE ALSO πΈ
Date::Parse, Time::Zone, DateTime, DateTime::TimeZone, DateTime::TimeZone::Alias, <http://datetime.perl.org/>
And that's the whole page, bestie! This one's brought to you by perl v5.42.0, dated 2011-12-14 β a lil vintage, but she still slays β¨π Go parse something cute π
π¦ where this page comes from
- opensuse-leap 16.0: perl-DateTime-Format-DateParse 0.05-bp160.1.11 Β· GPL-2.0 or Artistic-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms