RE: [PHP] client time zone?

2008-01-08 Thread Wolf
Sure, have a look on google for php: time zone class and you should be good to 
go!

What code have you written so far to try using the  data from the server?

Wolf

-Original Message-
From: jekillen [EMAIL PROTECTED]
Sent: Saturday, January 05, 2008 10:51 PM
To: PHP General list php-general@lists.php.net
Subject: [PHP] client time zone?

Hello;
I am running a server that is using UTC
and I want to be able to convert to
clients local time in some display presentations.
Is this indicated by $_SERVER[REQUEST_TIME]?
If not, is there a way to get the requesting host's
time zone so I can offset the servers clock value correctly?
Thank you for info:
Jeff K

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] client time zone?

2008-01-06 Thread Per Jessen
jekillen wrote:

 Hello;
 I am running a server that is using UTC and I want to be able to
 convert to clients local time in some display presentations.
 Is this indicated by $_SERVER[REQUEST_TIME]?

Is there such a value at all?  

 If not, is there a way to get the requesting host's
 time zone so I can offset the servers clock value correctly?

I think you'll need to use javascript.


/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] client time zone?

2008-01-06 Thread Ólafur Waage
To get the clients time offset you'll need to use javascript and
date.getTimezoneOffset()

But this idea has a problem. It is that you can never trust that the
clients time is actually correct. You can get the closest to it by
using the server time and offsetting that with the javascript offset
value. But you'll never know if the client has the wrong timezone and
you'll have to deal with timezones that don't have daylight savings
like for instance Iceland :)

- Ólafur Waage

2008/1/6, Per Jessen [EMAIL PROTECTED]:
 jekillen wrote:

  Hello;
  I am running a server that is using UTC and I want to be able to
  convert to clients local time in some display presentations.
  Is this indicated by $_SERVER[REQUEST_TIME]?

 Is there such a value at all?

  If not, is there a way to get the requesting host's
  time zone so I can offset the servers clock value correctly?

 I think you'll need to use javascript.


 /Per Jessen, Zürich

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] client time zone?

2008-01-06 Thread jekillen


On Jan 6, 2008, at 8:04 AM, Ólafur Waage wrote:


To get the clients time offset you'll need to use javascript and
date.getTimezoneOffset()

But this idea has a problem. It is that you can never trust that the
clients time is actually correct. You can get the closest to it by
using the server time and offsetting that with the javascript offset
value. But you'll never know if the client has the wrong timezone and
you'll have to deal with timezones that don't have daylight savings
like for instance Iceland :)

- Ólafur Waage

2008/1/6, Per Jessen [EMAIL PROTECTED]:

Thanks for the info.
I can live with this, I think. The javascript can give me
a good enough value for what is important. I am tracking
registered user use and can compare relative values to
see if there is a radical change, indicating that someone
may have managed to spoof a restricted connection.
That, in addition to the source of the requests can give
me an indication of problems. As far as the display is
concerned, I can have a help item that informs the user
that if the time displayed is not right for their location,
they may have their time zone set wrong, or in the case
you suggested, they may be in a time zone that does
not use daylight savings time, or some other difference.
Jeff K


jekillen wrote:


Hello;
I am running a server that is using UTC and I want to be able to
convert to clients local time in some display presentations.
Is this indicated by $_SERVER[REQUEST_TIME]?


Is there such a value at all?


If not, is there a way to get the requesting host's
time zone so I can offset the servers clock value correctly?


I think you'll need to use javascript.


/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] client time zone?

2008-01-05 Thread jekillen

Hello;
I am running a server that is using UTC
and I want to be able to convert to
clients local time in some display presentations.
Is this indicated by $_SERVER[REQUEST_TIME]?
If not, is there a way to get the requesting host's
time zone so I can offset the servers clock value correctly?
Thank you for info:
Jeff K

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php