FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » mktime() changes days when it should't
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: mktime() changes days when it should't [message #172425 is a reply to message #172418] Thu, 17 February 2011 13:03 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On 17/02/11 04:12, TAXI wrote:

> Thank you, but that's not what I need. Your script would execute the
> action at the first day of every month.
> I want it exactly after one month, so when it's executed today the
> first time the next execution should be the 17.03.2011, then the 17.04.
> and so on. But the execution of the first time isn't static, too.

It's certainly the base of what you need. You just need to play around
with the if clause that decides if it is one month since the script was
last run.

If you can't work out the logic involved to do that, then you're not
ready to program computers yet.

Did you look at the php.net documentation for mktime()? Did you consider
adapting the if clause to include a check for day of month?

crontab is still the better solution if you want a job to run at exactly
the same time every month.

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Almost done - Just need a way to assign a variable
Next Topic: Grate opportunities to earn money from online!
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 01:00:20 GMT 2024

Total time taken to generate the page: 0.04987 seconds