Andrea said:
for the timestamp you can use the Date request header. It's not
mandatory, but it should be used often.
For the timezone you can take the ip address of the request and then use
one of those services that map the ip address to the location. If the
timezone is not directly available you can get it from the longitude.
Weird requirements you have
Yeah, weird is right.
I don't think that the HTTP RFC actually defines a Date *request*
header, in fact. I've only ever seen it in the *response*, placed there
by the server.
The request (using IE6):
GET
http://google.com:80/ HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; .NET CLR 2.0.50727)
Host: google.com
Proxy-Connection: Keep-Alive
The response:
HTTP/1.0 302 Found
Date: Mon, 23 Oct 2006 13:18:43 GMT
Content-Type: text/html
Cache-Control: private
Server: GWS/2.1
Location:
http://www.google.com/
Note, no Date header in the request.
So, to answer the OP's question, use your own Date (new Date()) to get
the time of the request (to within a VERY close approximation of the
actual time it was received - I'm talking a few milliseconds, anyway).
And if you *REALLY* need to figure out the time zone of the caller,
probably IP geolocation is your only way of getting a reasonable
approximation. But that is a very strange thing to want to do,
especially for EVERY request. That is the sort of thing that you can get
through post-processing your logs, which will significantly improve your
user's experience with your service.
Rogan