Thursday, September 4, 2008

Get Client local time and GMT settings

To get the client local timeoffset and other timezone related parameters from the client machine in javascript, write the below code in the pre-load event:

protected void Page_PreLoad(object sender, System.EventArgs e)
{
string jScript;
jScript = "";
Page.ClientScript.RegisterStartupScript(this.GetType(), "parentwindow", jScript);
}

No comments:

About Us