mathieu_cupryk
asked on
date of birth control for visual 2005
i need a date of birth control for visual 2005.
some corrections to my example:
DateTime dob = this.dateTimePicker1.Value ;
string year = dob.Year.ToString();
string month = dob.Month.ToString();
string day = dob.Day.ToString();
string dobInShort = dob.ToShortDateString();
DateTime dob = this.dateTimePicker1.Value
string year = dob.Year.ToString();
string month = dob.Month.ToString();
string day = dob.Day.ToString();
string dobInShort = dob.ToShortDateString();
ASKER
I cannot use the calendar control it is too big,
where is the datetimepicker?
where is the datetimepicker?
ASKER
it is a web form.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could use the DateTimePicker control thats available in the toolbox... to get the selected date use the Value property which returns a DateTime object:
DateTime dob = this.dateTimePicker1.Value
Then use the DateTime properties and methods, e.g.:
string year = dob.Year;
string month = dob.Month;
string day = dob.Day
string dobInShort = dob.ToShortDateString();