Introduction
Sometimes we want to get server side date-time but we do not have our server to do it. This article teaches you how you can do this (I use Google.com's Header site).
Background
I use the System.Net
Namespace to do it.
Using the code
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();
DateTime Date = DateTime.Parse(res2.Headers["Date"]);
Now , you can get server side date and time in your DateTime
variable.
Enjoy ;-)
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.