How to convert string with unusual format into datetime

前端 未结 9 872
半阙折子戏
半阙折子戏 2021-01-19 17:15

I\'m using .NET 3.5 and I have a date that comes in as string in the following format:

Tue Jan 20 20:47:43 GMT 2009

First questi

9条回答
  •  执笔经年
    2021-01-19 17:44

    Try to do a DateTime.Parse("Tue Jan 20 20:47:43 GMT 2009") and see if it accepts it.

    Here's a good link for custom DateTime formatting.

    http://msdn.microsoft.com/en-us/library/8kb3ffffd4.aspx

    I hope that helps.

提交回复
热议问题