PDA

Click to See Complete Forum and Search --> : [RESOLVED] DatetimePicker


daimous
Aug 2nd, 2006, 02:26 AM
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!

jmcilhinney
Aug 2nd, 2006, 02:34 AM
To get a string:string shortYear = myDTP.Value.ToString("yy");To get a number:int shortYear = myDTP.Value.Year % 100

daimous
Aug 2nd, 2006, 03:31 AM
Thanks a lot for that!!!