Is there anything standard in C# to transform in to out. I don't mind ad hoc routine either.
string in = "1 February 2001"
string out = "2001/02/01"
Is there anything standard in C# to transform in to out. I don't mind ad hoc routine either.
string in = "1 February 2001"
string out = "2001/02/01"
Console.WriteLine(DateTime.Parse("1 February 2001").ToString("yyyy/MM/dd"));
This assumes you're always in the en-US culture.
string in = "1 February 2001";
DateTime dt = DateTime.Parse(in);
string out = dt.ToString("yyyy/MM/dd");
DateTime dt = Convert.ToDateTime("1 February 2001", new CultureInfo("2001/02/01"));
You will want to parse the date in exact format than relying on the culture
DateTime.ParseExact(dateString, "d MMMM yyyyy", CultureInfo.InvariantCulture).ToString("yyyy/MM/dd");