Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if x months have passed in asp.net mvc

I have a budgeting application that sets a budget for n months how can the application know if n months have passed and to unapply the budget? How does mvc automatically check?

like image 939
user4783644 Avatar asked Jan 01 '26 02:01

user4783644


1 Answers

Steve's answers above make a simple example of doing that. If you want to make it automatically, you should put it on some services and call it from a scheduler or some services like Hangfire or Quartz.

(DateTime.Now - StartDate)

If this validation has something to do with sending an email notification and so on, I prefer check it from Database and make an SQL job to run it every day or anytime you think its fit in.

like image 52
Martin Valentino Avatar answered Jan 03 '26 15:01

Martin Valentino



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!