Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Compare Date

by mojotoad (Monsignor)
on Mar 05, 2002 at 18:23 UTC ( #149461=note: print w/replies, xml ) Need Help??


in reply to Compare Date

The Date::Manip module provides some easy methods for dealing with this sort of thing on a pretty high level. It's slower than Date::Calc but for your problem it sounds like a one-shot calculation up front. For example you could do this:
$next_date = DateCalc($cur_date,"+ 1 month");
and it just does the right thing.

In your case, though, it sounds like you'd be looking backwards, so you might be using more along the lines of:

$activation_date = DateCalc('today', '- 1 month');
then checking your database for folks that signed up then.

Matt

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://149461]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2023-12-04 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (20 votes). Check out past polls.

    Notices?