Retrieving a DateTime value from a DataRow (C#)

后端 未结 8 1392
别跟我提以往
别跟我提以往 2020-12-09 04:06

How can I get DateTime value in C# from row, the current code is giving me error any help is appreciated, the data is coming in from progress database:

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 04:21

    If you have a DateTime string with a special format (not any standard .NET DateTime format) that needs to be converted to .NET DateTime type, you can use DateTime.ParseExact() method.

    Please see the MSDN document for more details including examples.

    If you have multiple formats to parse, try DateTime.ParseExact Method (String, String[], IFormatProvider, DateTimeStyles)

提交回复
热议问题