Reputation: 1
I'm trying to have the user select a date on a month calendar and then display it in the format yyyymmdd
. Currently I am trying to do it like this:
string date = completionCalendar.SelectionEnd.ToString("yyyymmdd");
However the issue I'm having is that when I run this I either get 00 as the month or 59 and I'm not sure what I've done wrong, any help would be appreciated.
Upvotes: 0
Views: 79
Reputation: 3745
use MM
for Month:
string date = completionCalendar.SelectionEnd.ToString("yyyyMMdd");
Upvotes: 1