hello guyz!!! how can i get the last 2 digits of the year from the value of my datetimepicker? say, datetimepicker1 has a value of 8/2/2006 how can i get the '06' from 8/2/2006? thanks in advance!
Printable View
hello guyz!!! how can i get the last 2 digits of the year from the value of my datetimepicker? say, datetimepicker1 has a value of 8/2/2006 how can i get the '06' from 8/2/2006? thanks in advance!
To get a string:To get a number:Code:string shortYear = myDTP.Value.ToString("yy");
Code:int shortYear = myDTP.Value.Year % 100
Thanks a lot for that!!!