Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Counting days with DateTime

by soonix (Canon)
on Apr 02, 2020 at 08:36 UTC ( [id://11114950]=note: print w/replies, xml ) Need Help??


in reply to Counting days with DateTime

The duration class is DateTime's way to specify whether your '7' stands for '7 seconds' (as it would be in unix time stamps), or '7 days', '7 years', or other units in between. You'd have to write
DateTime::Duration->new( days => 7 )
or, since in the text you you wrote "1 week", not "7 days":
DateTime::Duration->new( weeks => 1 )
instead of that simple 7.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-25 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found