jd2007 Posted July 13, 2007 Share Posted July 13, 2007 how to i tell php to execute something if 30 days has already passed ? Link to comment https://forums.phpfreaks.com/topic/59805-php-datetime/ Share on other sites More sharing options...
infid3l Posted July 13, 2007 Share Posted July 13, 2007 how to i tell php to execute something if 30 days has already passed ? Try a cron job? And 30 days from when? Link to comment https://forums.phpfreaks.com/topic/59805-php-datetime/#findComment-297357 Share on other sites More sharing options...
GingerRobot Posted July 13, 2007 Share Posted July 13, 2007 Yes, if you need to have an automated process that runs every 30 days, use a cron job. However, this might not be a necessity. For example, if you need to make something appear to happen every 30 days to a user, you can check if 30 days have passed since the event each time they log in perhaps. If 30 or more days have passed, you can perform your process. It rather depends on the situation. Link to comment https://forums.phpfreaks.com/topic/59805-php-datetime/#findComment-297359 Share on other sites More sharing options...
infid3l Posted July 13, 2007 Share Posted July 13, 2007 Maybe this: <?php if(strtotime("now") - strtotime("11 July 2007") > 2678400)) { //30 days has passed } ?> Link to comment https://forums.phpfreaks.com/topic/59805-php-datetime/#findComment-297364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.