Re: subtracting one date from another

[email protected] ("jagdish eashwar")
Newsgroups perl.datetime
Message-ID <[email protected]>
On Nov 28, 2007 8:54 PM, Zefram <[email protected]> wrote:

> jagdish eashwar wrote:
> >$dur = $date1->delta_days($date2);
>
> This is correct as far as it goes.
>
> >print $dur->days,"\n";
> ># This gives me --------- "4"
>
> Here the duration is being expressed in weeks plus days, and you're
> only looking at the days portion.  $dur->weeks returns 4; the duration
> is 4 weeks plus 4 days.  To get the duration expressed purely in days,
> do $dur->in_units("days").
>
> -zefram
>

Hi zefram,

Thank you so very much.

jagdish
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.