At 12:45 08.06.2001 -0700, you wrote:
>--- Brian Hersey <[EMAIL PROTECTED]> wrote:
> > my $presesntdate = (localtime);
>
> my ( $day, $month, $year ) = (localtime)[3..5];
> $month++; # assume you want 1-12 instead of 0-11
> $year += 1900;
>
> > 2. How do I compare the date values, so that I can get a numerical value of
> > days since the user first registered?
Whenever I deal with dates, I like to keep them in number format until I
need to display them -- it makes them easier to store and compare. In
other words
my $time = localtime
gives me seconds since Jan 1, 1970, and I store it in the database like that.
my $newTime = localtime
when the user logs back on, and now I can do:
$timePassed = $newTime - $time
and I have seconds that have passed between the first logon and the current
logon.
then you just do some math to get the days, months, years, etc out, if
that's what you want to do -- I don't know if there's a module that handles
this kind of stuff.
Aaron Craig
Programming
iSoftitler.com