Re: GMT / TimeZone modifications

From: Date: Thu, 11 Apr 2002 13:03:54 +0000
Subject: Re: GMT / TimeZone modifications
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-92558@lists.php.net to get a copy of this message
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" <oblivion@lunamorena.net> To: <php-general@lists.php.net> 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 > oblivion@lunamorena.net > +46 (0) 736 849 531 for sure contact.. > > > "Rasmus Lerdorf" <rasmus@lerdorf.ca> wrote in message > news:Pine.LNX.4.44.0204101903420.22264-100000@christine.ca... > > 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 > > > oblivion@lunamorena.net > > > +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 >

« previous php.general (#92558) next »