CGI::U...::date(3pm)
β¨ CGI::Untaint::date β¨
okay bestie, so this is the manual page for CGI::Untaint::date, from the User Contributed Perl Documentation collection. she validates dates. that's it. that's the whole vibe. π
πΈ NAME πΈ
CGI::Untaint::date β validate a date ποΈβ¨
π¦ SYNOPSIS π¦
use CGI::Untaint;
my $handler = CGI::Untaint->new($q->Vars);
my $date = $handler->extract(-as_date => 'date');
literally that's all you gotta do, no cap. π«Ά
π DESCRIPTION π
π is_valid
so this Input Handler checks that it's dealing with a reasonable date. and "reasonable" here means anything that Date::Manip thinks is sensible β so basically you can throw any of these at it (for example):
"December 12, 2001"
"12th December, 2001"
"2001-12-12"
"next Tuesday"
"third Wednesday in March"
the way it just accepts "next Tuesday"?? iconic. ππ
if you wanna know way more about which date formats are acceptable, go read Date::Manip β she has the whole lore.
and the resulting date? it'll be a Date::Simple object. Date::Simple for more info on that. β¨
π date_format
by default, ambiguous dates like 08/09/2001 get treated as UK style β so that's the 8th of September, not the 9th of August. π¬π§
if you wanna change that, subclass it and override date_format(). easy peasy. π
π WARNING π
Date::Manip does NOT play nicely with taint mode. π
to work around this, we locally clobber Date::Manip's 'timezone' code. since we're only interested in dates and not times, this shouldn't be much of an issue. but if it is an issue for you, then please let me know! π
π§ SEE ALSO π§
Date::Simple. Date::Manip.
β AUTHOR β
Tony Bowden
π BUGS and QUERIES π
please direct all correspondence regarding this module to:
bug-CGI-Untaint-date@rt.cpan.org
π COPYRIGHT and LICENSE π
Copyright (C) 2001-2005 Tony Bowden. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie π«Ά this one came from perl v5.34.0, dated 2022-06-10, and it's filed under CGI::U...::date(3pm). slay, go validate some dates πβ¨πΈ
π¦ where this page comes from
- debian bookworm: libcgi-untaint-date-perl 1.00-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-untaint-date-perl 1.00-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-untaint-date-perl 1.00-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-untaint-date-perl 1.00-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-untaint-date-perl 1.00-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms