Format date

xiaoxiao2021-03-06  65

I use date format

DD / mm / yyyy

But my machine's date format is YYYY-MM-DD

I use DateTime.Parse (String) but can only format the date similar to the YYYY-MM-DD format.

Parse has other parameters overload, but it seems to see, I don't know how to get it, make it able to analyze

DD / MM / YYYY date format, hopes to answer

-------------------------------------------------- -------------

DateTimeFormatinfo di = new datetimeformatinfo ();

Di.shortdatePattern = "DD / MM / YYYY";

DateTime D = DateTime.Parse ("12/12/2001", DI);

转载请注明原文地址:https://www.9cbs.com/read-92735.html

New Post(0)