On Fri, Jan 22, 2010 at 11:09 AM, newbie01 <newbie01.p...@gmail.com> wrote:

> Hi all,
>
> Need some advise please on how do date arithmetic/calculation.
>
> Basically, I have a CSV delimited file that I need to do some date
> calculations on.
>
> Am parsing the fields as $date1 and $date2 and I need to do the time
> difference as $date2-$date1
>
> Example of $date1 and $date2 below:
>
> $date1="31/12/2009 6:14:25 p.m."
> $date2="31/12/2009 6:29:26 p.m."
>
> Am still Googling and posting this at the same time ... :-)
>
> Any suggestion will be very much appreciated. Thanks in advance.
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>
There are many different date calculation options on CPAN (search.cpan.org)
try search terms as "date manipupaltion" or "date calculation" and you
should have a good long list with possible modules to do this work for you.

As date calculation is far more difficult than it seems at first glance,
leap years every 4 year and every 100 etc, but also leap seconds if you
really get into it, and then the different calendars that people used and
some still use not to forget the timezones that you might need to take into
account. All in all it could become quite messy.
I would therefore advise to always look for a module that fits with the
calcualtions you are going to be doing and the type/format of date data that
you are going to be processing. There is to my knowledge not a single module
that does it all, but pretty much all possible scenario's have been solved
so shop around a bit I'm sure you will find what you are looking for.

Regards,

Rob

Reply via email to