Page 1 of 1

Is their a way to find out users computer time in php?

Posted: Sun Jul 08, 2007 10:11 pm
by dustout
I have been working on a php dynamic sig that counts down to events and converts the time into a way that doesnt require timezones. Currently the below two designs are the best looking ones. However if their were a way to load the users computer time into the algorithm then it would become alot easier to display the converted time.

So basically i want to know if their is a method that i can use to load the users computer time into a variable named usrtime


Design 1
Image

Design 2
Image

Posted: Sun Jul 08, 2007 10:14 pm
by feyd
If your only interaction point is provided by an image link the only information you will receive will be in the request headers. I don't recall browsers sending their time information in requests.

Posted: Sun Jul 08, 2007 10:24 pm
by dustout
feyd wrote:If your only interaction point is provided by an image link the only information you will receive will be in the request headers. I don't recall browsers sending their time information in requests.
as far as i know the below snippit is all i recieve from the average image request
121.45.176.71 - - [01/Jul/2007:00:10:04 -0500] "GET /sig/mssw2dynsig.png HTTP/1.1" 200 19261 "http://www.ladyraven.biz/forums/viewtop ... 8&start=15" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"


I just figured that since some ads say "Meet people in Edmonton" (edmonton being where i live) it would be possible to get someone's time as well. Perhaps their is a link between IP address and timezone :?

Posted: Sun Jul 08, 2007 10:31 pm
by feyd
There is "some" correlation between IP and location, but it's sometimes quite inaccurate. In some regions you need that accuracy to determine timezone. There's typically more information in the request headers outside of those recorded by Apache logs. Some of this data is provided in $_SERVER. You may also be able to use apache_request_headers().

Posted: Sun Jul 08, 2007 11:05 pm
by dustout
feyd wrote:There is "some" correlation between IP and location, but it's sometimes quite inaccurate. In some regions you need that accuracy to determine timezone. There's typically more information in the request headers outside of those recorded by Apache logs. Some of this data is provided in $_SERVER. You may also be able to use apache_request_headers().
I didnt see anything in the apache_request_headers() info thing that would allow me to do what i want to do :(

i guess their isnt an easy and efficent way to do this like i was hopeing, but before i give up i'll take a look into the ip location method just for kicks :P