using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.Globalization;
public static void Main()
DateTime dt = new DateTime();
Console.Write("Please enter your birth date in YYYY.MM.DD format: ");
userInput = Console.ReadLine();
while (!DateTime.TryParseExact(userInput, "yyyy.MM.dd",
CultureInfo.InvariantCulture,
Console.WriteLine("You were born on: \"{0}\"\n", dt.ToString("yyyy.MMMM.dd"));