locked
Convert milliseconds fromat to datetime RRS feed

  • Question

  • User-257070954 posted

    Hi all,
               How convert 05252010125456000 to 5/25/2010 12:54:56:000

    Thursday, March 1, 2018 5:04 AM

All replies

  • User516094431 posted

    How convert 05252010125456000 to 5/25/2010 12:54:56:000

    Required Solution:

    DateTime myDate = DateTime.ParseExact("05252010125456000", "MMddyyyyHHmmssfff",
                                           System.Globalization.CultureInfo.InvariantCulture);
    string reqDate = myDate.ToString("M/dd/yyy HH:mm:ss:fff");
    Console.WriteLine(reqDate);

    Thursday, March 1, 2018 5:55 AM