+ 1
C# DateTimePicker Help
I’m trying to create the Magic Dates program using the DateTimePicker. I am just not sure how to grab the individual values, such as day, year, or month, from it. My code returns the entire selection { DateTime myDate = myDateTimePicker.Value; lblOutput.Text = myDate.ToString(“F”); }
1 Resposta
0
string month= dateTimePicker1.Value.ToString("MMMM");
I have not tested it myself but according to this link.
https://www.c-sharpcorner.com/forums/get-month-name-when-i-select-a-date-from-datetimepicker
you can use this format
https://www.c-sharpcorner.com/blogs/date-and-time-format-in-c-sharp-programming1