我已经编写了一些代码来根据基于位置的国家下拉菜单设置应用程序时间。它在本地运行良好,但在部署后无法在服务器中运行,请帮助...
Date Time AppTime = new DateTime();
protected void Page_Load(object sender, EventArgs e)
{
AppTime = new DateTime();
//Time Zone Changes for other Countries
TimeZoneInfo tzi1 = TimeZoneInfo.FindSystemTimeZoneById("AUS Eastern Standard Time");
DateTime IndTime = DateTime.Now;
DateTime CurrentUTC = TimeZoneInfo.ConvertTimeToUtc(IndTime);
DateTime OzzieTime = TimeZoneInfo.ConvertTimeFromUtc(CurrentUTC, tzi1);
string SelectedCountry = ddlCountry.SelectedValue.ToString();
string Australia = ConfigurationManager.AppSettings["AustraliaCountryID"];
if (SelectedCountry == Australia)
{
AppTime = OzzieTime;
}
else
{
AppTime = IndTime;
}
TextBox1.Text = AppTime.ToString();
TextBox2.Text = DateTime.UtcNow.ToString();
TextBox3.Visible = OzzieTime.ToString();;