Execute code when date changes?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Addaone
Forum Newbie
Posts: 1
Joined: Thu Jul 13, 2006 12:56 pm

Execute code when date changes?

Post by Addaone »

Is there a way to run some code when the date changes? I need to run some housekeeping code when either the date changes or the time is midnight. I'm a n00b...thanks in advance.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Well... you can run a maintenance script that basically checks whether a certain amount of time has passed, but in order for it to work, somebody or something has to execute it. (IE: visit your site)
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

or you can use cron
Post Reply