Date format is changing based on the culture when I am using DateTime.ParseExact() method.
I want to keep date in en-US culture always. Please see the below code I am using.
var date = DateTime.ParseExact("21072016 10:12:20",
"ddMMyyyy HH:mm:ss",
new CultureInfo("en-US",false));
string ff = date.ToString("yyyyMMddHHmmss");
When changing culture to ar it is converting date as in arabic calendar (16101437 10:12:20).
CultureInfo cInfo = new CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = cInfo;
Thread.CurrentThread.CurrentUICulture = cInfo;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With