Last active
August 29, 2015 14:00
-
-
Save marioangulo/ad5bb5083d954594b475 to your computer and use it in GitHub Desktop.
Cron Once Per Day.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mymodule_hook() { | |
// today's date as of midnight, exp. 04/16/09 12:00:00 am | |
define('TODAY', mktime(0, 0, 0, date('n'), date('j'), date('Y'), 0)); | |
if (variable_get('daily_cron', TODAY) != TODAY) { | |
variable_set('daily_cron', TODAY); | |
// do whatever else you need | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment