Date Diff... ? [modified]
-
I have Date.. which is user input by using " DateTimePicker " ... But now i want to make sure this user is uder 18 year or not... So what should do ? -Thanks
Peter
modified on Thursday, April 3, 2008 2:48 PM
pakpatel wrote:
But now i want to chek if this user is uder 18 year or not
There is no way to tell without meeting in person, and even then it can be iffy. Whenever a Website asks for my birthdate I use 1900-01-01 and watch what happens.
-
I have Date.. which is user input by using " DateTimePicker " ... But now i want to make sure this user is uder 18 year or not... So what should do ? -Thanks
Peter
modified on Thursday, April 3, 2008 2:48 PM
pakpatel wrote:
But now i want to chek if this user is uder 18 year or not
That is not possible with the information given. You can check if the date entered is at least 18 years ago. Just take the current date, subtract 18 years from it, and compare the dates:
if (enteredDate <= DateTime.ToDay.AddYears(-18)) ...
Despite everything, the person most likely to be fooling you next is yourself.
-
pakpatel wrote:
But now i want to chek if this user is uder 18 year or not
That is not possible with the information given. You can check if the date entered is at least 18 years ago. Just take the current date, subtract 18 years from it, and compare the dates:
if (enteredDate <= DateTime.ToDay.AddYears(-18)) ...
Despite everything, the person most likely to be fooling you next is yourself.