大家好我有一个表格,其中一个字段显示IST(亚洲/加尔各答时区)的服务器时间。现在,当软件在我的本地服务器上时,它显示当前的IST时间,但是当它在远程服务器上时显示UTC时间。我必须显示IST(UTC + 5:30)。
我使用过代码:
public void ProcessRequest(HttpContext context)
{
string sid = "JUN15MBACHN001";
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
connection.Open();
SqlCommand command = new SqlCommand("select suppassportphoto from studdetails where sregno=" + sid, connection);
SqlDataReader dr = command.ExecuteReader();
dr.Read();
Byte[] br = (Byte[])dr[0];
if (br.Length > 1)
{
context.Response.BinaryWrite((Byte[])dr[0]);
}
else
{
string path = context.Server.MapPath("~/image/emptymalepic.jpg");
byte[] byteArray = File.ReadAllBytes(path);
context.Response.BinaryWrite(byteArray);
}
connection.Close();
context.Response.End();
}
public bool IsReusable
{
get
{
return false;
}
}
如何获得IST而不是UTC。