简体   繁体   中英

Month Calendar fetching wrong date?

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.

每月使用MM

  string date = completionCalendar.SelectionEnd.ToString("yyyyMMdd");

"m" is the format for minutes. "M" is for months.

MSDN

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM