Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Answer: How to get time in seconds from localtime(time) to next 21st date of the month?

( #47516=categorized answer: print w/ replies, xml ) Need Help??

Q&A > dates and times > How to get time in seconds from localtime(time) to next 21st date of the month? contributed by Fastolfe

Yes I see your restriction against using Date::Manip, and I'm not going to bother asking what that's all about, but in the event someone else comes upon your question (which is the purpose for posting it into Q&A, right?), they may not have such restrictions placed on their development. In such a case, the following code might be useful:
use Date::Manip; $diff = &DateCalc("now", "21st at midnight"); $seconds = &Delta_Format($diff, 0, "%st");
You can certainly use other modules such as Date::Calc, but it will require additional logic.

Comment on Answer: How to get time in seconds from localtime(time) to next 21st date of the month?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (15)
As of 2015-07-01 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (16 votes), past polls