Convert US date to EU date in C# project?
using System; using System.Globalization; public class Example { public static void Main() { string dateString, format; DateTime result; CultureInfo provider = CultureInfo.InvariantCulture; // Parse date-only value with invariant culture. dateString = "11/25/2019"; format = "d"; try { result = DateTime.ParseExact(dateString, format, provider); Console.WriteLine("{0} converts to {1}.", dateString, result.ToString()); } catch (FormatException) { Console.WriteLine("{0} is not in the correct format.", dateString); } // Parse date-only value without leading zero in month using "d" format. // Should throw a FormatException because standard short date pattern of // invariant culture requires two-digit month. dateString = "11/25/2019"; try { result = DateTime.ParseExact(dateString, format, provider); Console.WriteLine("{0} converts to {1}.", dateString, result.ToString());