On Fri, Apr 26, 2002 at 08:32:21AM -0400, Tara Calishain wrote:

> I'm anticipating coming across this same problem with user input dates, and
> I don't expect the seconds trick will work for that one.
> 
> For example, say a user specified $day-$month-$year and ten days, and I
> wanted to generate a date string for every day going back ten days.

Although Randal L. Schwartz posted a hillarious comment on Date::Manip

    (http://archive.develooper.com/beginners%40perl.org/msg22416.html)

you should take a look at that module.  I have used it quite a lot to
let people pass more or less generic time/date specifications to my
scripts.  It does for example things like that:

    ---------- snip ----------
    nijushiho:~# perl -MDate::Manip -le 'print UnixDate("44 days ago", "%Y%m%d")'
    20020313
    nijushiho:~# 
    ---------- snip ----------

It comes at a price though, so I wouldn't use it to process some 20 million
lines of webserver logs in a nightly run :-)

-- 
                       If we fail, we will lose the war.

Michael Lamertz                        |      +49 221 445420 / +49 171 6900 310
Nordstr. 49                            |                       [EMAIL PROTECTED]
50733 Cologne                          |                 http://www.lamertz.net
Germany                                |               http://www.perl-ronin.de 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to