开发者

Convert date into the format dd-mm-yyyy

开发者 https://www.devze.com 2022-12-15 07:37 出处:网络
How to convert the date (12/24/2009 12:48:00 PM) into the format dd-mm-yy? I tri开发者_如何学Pythoned the following code:

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

I tri开发者_如何学Pythoned 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");
0

精彩评论

暂无评论...
验证码 换一张
取 消