gcue Posted November 10, 2009 Share 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 Link to comment Share on other sites More sharing options...
GodlessSinner Posted November 10, 2009 Share Posted November 10, 2009 The logic is: If month_difference => 1 and current_date => 22 then RESET Reset { write current month in your .ini } _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
gcue Posted November 11, 2009 Author Share Posted November 11, 2009 sounds good!!! many thanks =) Link to comment Share on other sites More sharing options...
GodlessSinner Posted November 11, 2009 Share Posted November 11, 2009 Also remember about negative difference(January minus December = -11) or check a year too... _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
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