Skip to content

Instantly share code, notes, and snippets.

Created Dec 12, 2021
What would you like to do?
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