Kemik Posted February 16, 2008 Share Posted February 16, 2008 Hello, I'm coding a budget application. Basically, the section of code I'm working on will check if today is the start of a new week and if so it will add the weeks budget to the current balance. If today is > next week date fetch budgeted amounts per week from each category and current balance update category balance with current balance + budgeted amount update next week date for next coming sunday This piece of code will run every time the user visits the homepage. (Would this be easier to just use cron jobs?) I'm stuck on what happens if the user doesn't visit the site for two weeks. It will only add one weeks budget to the balance. Also, how would I calculate the date for the next coming sunday? I cannot use date + 7 as the user could visit on a tuesday, wednesday, etc. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/91390-calculating-if-its-a-new-week/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.