sql - How to find hour in getdate() is expired -
In my DB I have submitted time in the form of time, on my asp.net page, I want to retrieve it and Detected whether the recovery period has expired or not. The end time is 8 hours, what is the best way to do this?
I have tried this way but did not get the proper solution
datetime DB_time = convert. ToDateTime (dr_pass [2]. Ostring ()); // Time from the database if (db_time * datetime.now.addhours (-8)) // password is too old {return; } And {return true; }
datetime db_time = convert toDateTime (dr_pass [2] .tostring ()); // Time database if (datetime.now> db_time.AddHours (8)) {return true; // password is valid} other {return false; // password expired}
Comments
Post a Comment