Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Counting days with DateTime (updated)

by tobyink (Canon)
on Apr 02, 2020 at 07:18 UTC ( [id://11114946]=note: print w/replies, xml ) Need Help??


in reply to Re: Counting days with DateTime (updated x2)
in thread Counting days with DateTime

Consider using:

my $one_week_from_now = $now->clone->add( weeks=>1 );

This is because most of the DateTime add/subtract methods mutate the object the operated on, and you probably don't want $now to be a date in the future!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found