Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to check current system date format?

How can i check the system date format? Tried with the code below, but when i change my system's date format to another date format to test the code, it's still showing the date format before changed!

System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern()
like image 917
Fire Hand Avatar asked Jun 22 '12 06:06

Fire Hand


1 Answers

Ok. I managed to find the solution, the 'CurrentCulture' has to be 'CurrentUICulture', instead of CurrentCulture. Which is as below:

System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern()
like image 93
Fire Hand Avatar answered Oct 05 '22 16:10

Fire Hand