Just had to solve this problem the other day.  Here's a quick snippet to
display the time in Great Britain while my server's located in Boston:

<?
 putenv("TZ=GB");
 echo date("g:i a T")." on ".date("F j, Y");
 putenv("TZ=EST5EDT");
?>

This switches the timezone locale to GB, displays the local time there,
then switches back to Eastern US.

Peter


----- Original Message -----
From: "Richard KS" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 11:14 PM
Subject: Re: [PHP] GMT / TimeZone modifications


> Thanks for the quick answer!
> Perhaps you have a smaller code snippet for this?
>
> NOTE It wouldn't mind if the entire website would go after one timezone,
in
> this case from GMT+8 to GMT+1.
>
>
> --
> Richard,
>   oblivion creations
>   http://oblivion.lunamorena.net
>   [EMAIL PROTECTED]
>   +46 (0) 736 849 531 for sure contact..
>
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > setenv() the appropriate timezone, then use strtotime() or mktime() to
> > create a timestamp.  Then setenv() to the other timezone and use
date() or
> > strftime() to convert back into a legible format.
> >
> > -Rasmus
> >
> > On Thu, 11 Apr 2002, Richard KS wrote:
> >
> > > Greetings.
> > >
> > > I was wondering if there are any good ways of converting a date into
> another
> > > time zone? For instance, from GMT+8 to GMT+1, is this possible in
some
> way?
> > >
> > > Like if I have a date written 09.04.2002 14:11, I would like to
format
> it
> > > into GMT+1.. Any solutions?
> > >
> > > Thanks alot
> > >
> > > --
> > > Richard,
> > >   oblivion creations
> > >   http://oblivion.lunamorena.net
> > >   [EMAIL PROTECTED]
> > >   +46 (0) 736 849 531 for sure contact..
> > >
> > >
> > >
> > >
> > > --
> > > 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

Reply via email to