CGI::U...::date(3pm)

πŸ“¦
version 1.00 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 (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