Alas, I don't have this luxury since it's not my server, but one that is
hosted with a web hosting provider.  They control the setup and
configuration of the machines... since it's a shared server I doubt I'll
convince them to set the timezone to my location, thus throwing everyone
else on the same server out of whack...

I can use the putenv() function though for use in PHP and then when saving
the date and time into mySQL actually use the PHP date and time functions
instead of the mySQL Now() function...

Where would I find the TZ codes to use for my area?


> -----Original Message-----
> From: Don Read [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 24, 2001 8:39 PM
> To: Joe Sheble (Wizaerd)
> Cc: General PHP List
> Subject: RE: [PHP] local time v.s. server time
> On 25-Aug-2001 Joe Sheble \(Wizaerd\) wrote:
> > My website is hosted with a provider, and there is a three hour
> difference
> > in timezones, so when saving date and times to the database,
> they reflect
> > the server time and not my own local time.  The clincher is I
> know I could
> > do some time math and just substract 3 hours, but I live in
> Arizona, so we
> > do not go through daylight savings time.  So right now it's a three hour
> > difference, but when the time change happens, I'll only be two
> hours behind.
> >
> > Because of this, what is the best method to get my local date and time
> > entered into the database instead of the server date and time??
> >
> In my case the server is in Atlanta, but I have to sync with my
> credit-card
> processor on the left coast.
> So first i start the database (MySQL) on Pacific time with:
> -----
> export TZ
>     /usr/local/bin/safe_mysqld --user=mysql > /dev/null &
> ----
> To make PHP date/time functions jive, during initialization:
>    putenv('TZ=PST8PDT');  // Server on Pacific time
> No matter that i'm in Texas (CST), everything is now reported on Pac time.
> Regards,
> --
> Don Read                                       [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to
>    steal the neighbor's newspaper, that's the time to do it.

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to