PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > client time zone?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
client time zone?

Réponse
 
LinkBack Outils de la discussion
Vieux 06/01/2008, 04h51   #1
jekillen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 06/01/2008, 11h57   #2
Per Jessen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] client time zone?

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
  Réponse avec citation
Vieux 06/01/2008, 17h04   #3
Ólafur Waage
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] client time zone?

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 <per@computer.org>:
> 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
>
>

  Réponse avec citation
Vieux 07/01/2008, 01h33   #4
jekillen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] client time zone?


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 <per@computer.org>:

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 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
>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h32.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12057 seconds with 12 queries