You should look at the Date::Parse Module.
You can get it from CPAN.
cr
On Thu, 3 May 2001 14:48:51 -0400, Craig Moynes/Markham/IBM said:
> My task is to create a Log file pruner for multiple types of logfiles. Now
> this being reality both record seperators and date formats vary from log to
> log. I have already nailed the record seperator problem by allowing the
> user to input a regular expression as a parameter to define when a record
> ends and another begins. Now I have to deal with the date format.
>
> The idea is this: I want to keep all entries that are x days from today.
> I can get today in seconds and do some simple math and get the # of seconds
> since epoch at the start of the xth day away.
>
> My solution so far involves using the same formatting key as the *nix date
> function. It has a pretty decent specifier system for the different
> fields.
> Assuming I can get the 'date expression' into perl how should I proceed
> from there.
>
> Is there any good perl modules for help with the conversion from 'date type
> formatting' to an easier to work with format ? I would hate to have to
> write the little regexp for each of the date formats only to find out if I
> had used mod X I would have been done.
>
> I may consider using a C function I saw also, but if I resort to that I
> will send a seperate post requesting info on that topic.
>
> The one caveat is I cannot use any 3rd party modules (ie. no stuff from
> cpan) because those require 'legal consultations' which ends up being a
> huge hassle.
>
>
> Thanks guys and gals,
> C
>
> -----------------------------------------
> Craig Moynes
> Internship Student
> netCC Development
> IBM Global Services, Canada
> Tel: (905) 316-3486
> [EMAIL PROTECTED]
>
>
>