gcue Posted November 10, 2009 Posted November 10, 2009 (edited) i am trying to track down my monthly minutes for a calling plan i have.everytime i enter X minutes into a script it deducts X amount from the grand total of 2000 (which i am alotted per month.)my plan resets the minute count every 22nd of every month. in a perfect world, i can open the program every month on the 22nd, but what happens if i dont open it on that day? how can i tell the script to reset the count?i was thinking the following:track the day when it last resets. (write a date stamp in an ini file)thenif @mday = 22 and _datediff($today, $last_reset) > 28 then RESET (rewrite last reset date)but that will keep resetting trailing days if the month has more than 28 daysplease help! Edited November 10, 2009 by gcue
GodlessSinner Posted November 10, 2009 Posted November 10, 2009 The logic is: If month_difference => 1 and current_date => 22 then RESET Reset { write current month in your .ini } _____________________________________________________________________________
GodlessSinner Posted November 11, 2009 Posted November 11, 2009 Also remember about negative difference(January minus December = -11) or check a year too... _____________________________________________________________________________
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now