I am sharing this because it can be useful for a lot of developers dealing with date format issues in their projects.
I was writing some code to get back some date ranges and everything was working well on my machine. But the deployment failed on the production server for the reason that the OS was installed as an English American language.
The signature for that is en-US when obviously it is en-IE for Ireland. This is causing also some problems with the SQL boc, so an advice check before installing SQL Server that you have the right language option.
OK back to my code what I have done is to use the CultureInfo method you can find in the Globalization class to force the date format as an Irish one.
Here we go in C# :
DateTime myDate = Convert.ToDateTime(lst.SelectedItem.ToString(), new System.Globalization.CultureInfo("en-IE"));
here is a small list of the possible english cultures:
| Culture Name |
Culture Identifier |
Language-Country/Region |
| en |
0x0009 |
English |
| en-AU |
0x0C09 |
English - Australia |
| en-BZ |
0x2809 |
English - Belize |
| en-CA |
0x1009 |
English - Canada |
| en-CB |
0x2409 |
English - Caribbean |
| en-IE |
0x1809 |
English - Ireland |
| en-JM |
0x2009 |
English - Jamaica |
| en-NZ |
0x1409 |
English - New Zealand |
| en-PH |
0x3409 |
English - Philippines |
| en-ZA |
0x1C09 |
English - South Africa |
| en-TT |
0x2C09 |
English - Trinidad and Tobago |
| en-GB |
0x0809 |
English - United Kingdom |
| en-US |
0x0409 |
English - United States |
| en-ZW |
0x3009 |
English - Zimbabwe |