CGI::Untaint::date(3pm) User Contributed Perl Documentation CGI::Untaint::date(3pm)NAME
CGI::Untaint::date - validate a date
my $handler = CGI::Untaint->new($q->Vars);
my $date = $handler->extract(-as_date => 'date');
This Input Handler verifies that it is dealing with a reasonable date. Reasonably means anything that Date::Manip thinks is sensible, so
you could use any of (for example):
"December 12, 2001"
"12th December, 2001"
"third Wednesday in March"
See Date::Manip for much more information on what date formats are acceptable.
The resulting date will be a Date::Simple object. Date::Simple for more information on this.
By default ambiguous dates of the format 08/09/2001 will be treated as UK style (i.e. 8th September rather than 9th August)
If you want to change this, subclass it and override date_format()
Date::Manip does not play nicely with taint mode. In order to work around this we locally clobber Date::Manip's 'timezone' code. As we're
only interested in dates rather than times, this shouldn't be much of an issue. If it is, then please let me know!
BUGS and QUERIES
Please direct all correspondence regarding this module to:
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.
perl v5.10.0 2008-05-12 CGI::Untaint::date(3pm)
Check Out this Related Man Page
DM_DATE(1) User Contributed Perl Documentation DM_DATE(1)NAME
dm_date - print out the system date and time
This performs the same operation as the unix 'date' command, but using the Date::Manip module.
dm_date [OPTION]... [+FORMAT]
This displays information about the current system time, or some other time. Options are:
Print online help.
-d STRING, --date=STRING
Display time described by STRING. STRING can be any string which can be parsed by Date::Manip. Please refer to the Date::Manip::Date
documentation for details.
-f DATEFILE, --file=DATEFILE
This reads each line in DATEFILE, and extracts a date from it and prints out the information.
Blank lines and lines starting with a pound (#) are ignored. Lines not containing a valid date are also ignored.
-r FILE, --reference=FILE
Displays the last modification time of FILE.
Displayc the date and time in RFC 2822 format.
Example: Mon, 07 Aug 2006 12:34:56 -0600
-u, --utc, --universal
Converts the date to UT (GMT) and prints out the information.
Only one of -d, -f, or -r should be included. If more than one is included, the first one from the list (-d, -f, -r) is used and any other
The format string starts with a plus (+) and contains any of the format directives described in Date::Manip::Date.
BUGS AND QUESTIONS
Please refer to the Date::Manip::Problems documentation for information on submitting bug reports or questions to the author.
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Sullivan Beck (email@example.com)
perl v5.16.3 2014-06-09 DM_DATE(1)
I am trying write a script that takes user input date in the format "Mar 18". If it is march1 it is like "Mar 1" . Once i take this input i will go back to my log files and search for any failed transactions recorded that day. If there are then i will send it to a file and mail it.
I am... (10 Replies)
i am trying to change my date from 2001-01-21 to current date in file datein1 this is how i did
date11=`date +"%y %m %d "`
sed -e "s/2001-01-21 /$date11/g" datein1 > dateout
it runs fine when i run manually but doen not work on cron (10 Replies)
Hey Guyz I have a requirement something like this..
a part of file name, date of modification of that file and a text is entered as input.
Date : 080206 (MMDDYY format.)
filename : hotel_rates
text : Jim
now the file hotel_rates.ZZZ.123 (creation date is Aug 02 2006) should be... (10 Replies)
I have a few questions regarding a UNIX script I've been asked to write (even though I barely know UNIX!).
I would like to write a script, that when run, will copy a file from one directory to another, copy and rename the same file with a datestamp to an archive directory, and them... (10 Replies)
I want to extract a date and version code which shall come in filename consisting of underscores.
The filename can contain any / one underscores but the version number will come after date and will be separted by underscore
ABC_20090815_2.csv... (13 Replies)
I have a data file having first 19 characters having the date in the below format-
I have to check this date field ( first 19 characters) against some specific dates and if date is not in 3 valid dates ( business date available to me , business date - 1 , businessdate... (10 Replies)
I have shell script and I am facing the below issue to integrate the date calculation to the the script.
If I give the $1 as the date(20110701) then I need to get the 7 days ago date for the same format.(20110624).
At first I thought its a simple one to handle and I did a search in the... (10 Replies)
I tried to stay away from posting stuff here and asking for help.
I want to print date valeu for a given variable and that is not working.
START=`echo $1 | tr -d _`;
for (( c = 0 ; c < $FV ; c++ ))
# echo -n "`date --date="$START +$c day"... (12 Replies)
I want to perform a simple date comparisons, i.e. select all files modified after a certain date (say 12-feb-2011)
I do not have the option of creating a file and using find's -newer option.
Any simple way to do this? I can do this by reading the stat command's output and comparing... (10 Replies)
I have a variable which stores a date value in my script. let that be todays_date. This holds a date value which is based on some other calculation not relevant here.
I need the value of todays_date-1..ie previous date to this value...is that possible? (12 Replies)
So since I'm looking for an easy way to numberize files in a folder according to date:
Is there an easy script (batch, windows), that will rename files like this:
.earliest creation time: 001.file
older creatiin time : 002.file
even older time : 003.file
... (10 Replies)
I have Below Input :-
X1=03 ### Hour
Y1=20160405 ## Date
Z1=3 ## I want to Back 3 Hour
List=03 02 01
X1=02 ### Hour
Y1=20160405 ## Date
Z1=4 ## I want to Back 4 Hour
List=02 01 24 23
Y1=20160404 ### Date Will Change (13 Replies)
I have written a code in Linux environment which compares two dates and print "correct" if 1st date is less than 2nd date. But when I'm running the same code in SunOS environment, "date -d is an illegal format" is the error it is throwing. How different should my code be so that it executes well in... (18 Replies)