Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Counting days with DateTime

by soonix (Canon)
on Apr 02, 2020 at 08:36 UTC ( #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
Node Status?
node history
Node Type: note [id://11114950]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2020-06-04 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (35 votes). Check out past polls.

    Notices?