Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check IF expiration date occured

Tags:

c#

.net

I have access only to .NET, and I have this situation. At creating an game (or any object for that matter), I set expiration date (or any date, that's not really important). Date is set at some point in future. Now What I want to do is to check if that date occurred. And this should happen completely automatically. Without user interactions.

My question is.. ? Is that possible? And where to start?

EDIT:

I have date stored in database, and i want to periodically check if that date actually occurred. I guess asking server every second to check date stored in DB is not most optimal solution.

like image 858
Łukasz Baran Avatar asked Jan 14 '11 22:01

Łukasz Baran


1 Answers

You should be able to just fine...

if(DateTime.Now > expirationDate) { /* TODO:... */ }
like image 188
Quintin Robinson Avatar answered Oct 03 '22 14:10

Quintin Robinson