I\'m deploying a .NET applications to another machine.
in console application, the value of
DateTime.Today.ToLongDateString();
is
It's likely to be the culture of the machine itself - you say you're deploying to a different machine.
Which culture do you want it to be in?
EDIT: Your options are:
The last one is the least invasive, to be honest. Most methods like String.Parse
etc have an overload with an IFormatProvider
parameter. You can specify this as the relevant CultureInfo
.
In the web.config or machine.config you can specify the default culture for the ASP.Net application through the globalization element.
<configuration>
<system.web>
<globalization
culture="en-US"/>
</system.web>
</configuration>
It gets it from the machine. See here how you can change it.
I got the answer! it was one of the registry records of the users of probably ASPNET or IIS. by using regedit, i found in one of the users international = arabic
Thanks to: Change Default Locale in IIS 6.0
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
DateTime.Today.ToLongDateString();