The following method is able to convert a string of a given format into a DateTime variable.
CultureInfo provider = CultureInfo.InvariantCulture;By adding a month and taking away a second the date is set to the end of the month rather than the start of it.
var myDate = DateTime.ParseExact("08/16", "MM/yy", provider).AddMonths(1).AddSeconds(-1)
No comments:
Post a Comment