如何将 04/09/2013 8:09:10 PM 转换为 09/04/2013 (MM-dd-yyyy)。我试图转换,但它以 09 作为日期,以 04 作为月份。
请帮忙
[HttpPost]
public string getdailynote(DateTime selectedDate)
//selectedDate gets date as 04/09/2013 8:09:10 PM
{
string x = selectedDate.ToString("MM-dd-yyy", CultureInfo.InvariantCulture);
string daily;
DateTime dt = Convert.ToDateTime(x);
//dt gets value as {09/04/2013 12:00:00 AM} but 09 as date and 04 as month
Dnote.RealDate =dt;
daily = _scheduler.GetDailyNote(Dnote);
return daily;
}