I could be wrong, but I don't think you can since a valid DateTime must have
a Month, Day and Year. Try specifying a 1 for the day but not using when you
display it.
Fields which aren't specified are defaulted. Try the following program:
using System;
using System.Globalization;
class Test
{
static void Main()
{
DateTime dt = DateTime.ParseExact("10/00", "MM'/'yy",
CultureInfo.InvariantCulture);
Console.WriteLine (dt);
}
}
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.