jquery - To get Server's date and time to client machine -
I have 4-5 client machines and a server I want server date and time, but the customer's date and time No. If I need the customer's date and time then I could use DateTime.Now in jQuery in C # and var date = new date (). But I do not want it to be the server's date and time that I'm using jQuery or webservices or mvc.
string URL = "http://www.google.com"; System.Net.HttpWebRequest rq2 = (System.Net.HttpWebRequest) System.Net.WebRequest.Create (URL); System.Net.HttpWebResponse res2 = (System.Net.HttpWebResponse) rq2.GetResponse (); Date time date = date time Purse (res2.Headers ["date"]);
Now, you can get server side date and time in your datetime variable
Comments
Post a Comment