14.1.13

get specified format of the date from datetime picker

Here is a minor syntax to extract the date information from datetimepicker in windows forms c#


string VenkatDate = dateTimePicker1.Value.ToShortDateString();
To get the date in specified format:
string VenkatDate = dateTimePicker1.Value.ToString("yyyy-MM-dd");
Cheers,
Venkatesan Prabu. J
Head, KaaShiv InfoTech
www.kaashivinfotech.com

No comments:

Post a Comment