Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by davorg (Chancellor)
on Dec 20, 2000 at 03:34 UTC ( [id://47510]=note: print w/replies, xml ) Need Help??


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

This sounds pretty simple to achieve without modules. I won't write the code, but here's how I'd do it.

Use time to get the current epoch seconds Use localtime to convert that to date/time If the date is greater than 21 then increment the month number end set the date to 21 and the time to 12am use Time::Local::timelocal to convert that time to epoch seconds Subtract that from your first number
  • Comment on Re: 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://47510]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-18 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found