Created
December 12, 2021 13:44
-
-
Save nishanc/2a2badef31c386ef2bd8d44508a2945b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public DateTime ConvertToDateTime() | |
{ | |
private static readonly string _dateString = "01 05 1991"; | |
var day = _dateString.Substring(0, 2); | |
var month = _dateString.Substring(3, 2); | |
var year = _dateString.Substring(6); | |
return new DateTime(int.Parse(year), int.Parse(month), int.Parse(day)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment