문제

How to convert the date (12/24/2009 12:48:00 PM) into the format dd-mm-yy?

I tried the following code:

DateTime.TryParse(12/24/2009 12:48:00 PM,out registereddate);
  strregdate = registereddate.ToString("dd-mm-yyyy");

But, the output comes as 24-48-2009. How to convert

도움이 되었습니까?

해결책

Month is "MM", minute is "mm". You want:

DateTime.TryParse(12/24/2009 12:48:00 PM,out registereddate);
  strregdate = registereddate.ToString("dd-MM-yy");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top