DateTime.TryParse century control C#

前端 未结 5 1497
轻奢々
轻奢々 2020-11-28 15:57

The result of the following snippet is \"12/06/1930 12:00:00\". How do I control the implied century so that \"12 Jun 30\" becomes 2030 instead?

    string          


        
5条回答
  •  被撕碎了的回忆
    2020-11-28 16:23

    You're looking for the Calendar.TwoDigitYearMax Property.

    Jon Skeet has posted something on this you will likely find useful.

提交回复
热议问题